Russian-Doom / russian-doom

A limit-removing source port of Doom, Heretic and Hexen. It has numerous vanilla bug fixes, enhanced 640x400 and 1280x800 rendering resolutions, improved game palettes and offers many optional aesthetic game enhancements along with the maximum possible translation to the Russian language.
GNU General Public License v2.0
81 stars 13 forks source link

Doom: "Speed" value is ignored in Dehacked patches #358

Closed JNechaevsky closed 2 years ago

JNechaevsky commented 2 years ago

This explains tendency of horned rabbits in Rekkr running towards player and not in opposite direction, as their speed is -8. But how it was broken? 😧

fabiangreffrath commented 2 years ago

Perhaps because of this:

https://github.com/JNechaevsky/inter-doom/blob/3a363fb6cb996319d69735c4aad84ef6c3290cc0/src/deh_mapping.c#L109-L123

JNechaevsky commented 2 years ago

Nope, unlikely, it's same to Crispy, as well as whole sha1.c file. New speed is not working even with positive values, so it shouldn't be a endianness problem. What's more confusing - other nearest fields (radius, spawnhealth) are working fine as replaceable negatives/positives. Maybe something went wrong in mobj functions...

fabiangreffrath commented 2 years ago

It's not about endianess, the values are cast to unsigned integers.

JNechaevsky commented 2 years ago

Yeah, I can even assign negative speed to projectiles and this will work.

https://user-images.githubusercontent.com/21193394/178726614-6c1c290c-cf90-4f41-a27c-0e39ab296c1a.mp4

JNechaevsky commented 2 years ago

Argh, of course, parser is OK, values are simply being overwritten by these lines: https://github.com/JNechaevsky/inter-doom/blob/master/src/doom/g_game.c#L2200-L2232

fabiangreffrath commented 2 years ago

He, didn't you say it was the same in Crispy?

JNechaevsky commented 2 years ago

Who? Me? I was meaning Dehacked stuff, not g_game. 😛