Unchecked infinite recursion with P_BlackOw

Status
Not open for further replies.
Code:
addHook("ShouldDamage", function (hurt, hazard, hitter, damage)
    P_BlackOw(hurt.player)
end, MT_PLAYER)

Start a 2-player game, then shoot your opponent. Ta-da.
 
P_BlackOw calls P_DamageMobj as it happens. =V

By "unchecked infinite recursion" do you mean the game spouts another one of those "C stack overflow" errors for this sort of thing by any chance?
 
If you want, we can get a game running and you can see firsthand. It doesn't do an error when shooting someone else in match.
7289ee75ea.png

3ee839489d.png
 
Last edited:
Okay...

And what do you want us to do? You're responsible for the infinite recursion here, not the game.

"There's the possibility someone could take damage here. Do you want them to? Yes / No / Let the game handle it"
> "BLOW EVERYONE UP"
"Okay, so ... there's the possibility someone could take damage here. Do you want them to? Yes / No / Let the game handle it"
> "BLOW EVERYONE UP"
"Uh, okay ... there's the possibility someone could take damage here. Do you want them to? Yes / No / Let the game handle it"
> "BLOW EVERYONE UP"
"..."
Et cetera.

Not like you couldn't just call P_DamageMobj yourself for the exact same result.
 
The problem here is, though, that unlike every other time you can do an infinite loop, the game detects it and throws a C Stack Overflow error. But Using this while hitting another player in match causes the game to hard lock, instead of throw a Lua error.
 
Detecting an infinite loop is impossible. If it's not throwing a stack overflow error, then I guess no stack overflow has occurred. I'm sure that if you wait long enough, it will eventually run out of memory and crash.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top