Interrupt / systemshock

Shockolate - A minimalist and cross platform System Shock source port.
GNU General Public License v3.0
806 stars 65 forks source link

Missing break in trap scheduler func #256

Closed donnierussellii closed 5 years ago

donnierussellii commented 5 years ago

Clearly should be there; wonder what it fixes/breaks

Interrupt commented 5 years ago

How much testing did you do around traps after making this change? You're right in wondering how much of the game this could affect :D

donnierussellii commented 5 years ago

I only played through level 1 to test it and didn't notice anything peculiar.

donnierussellii commented 5 years ago

I used a recharging station, waited for it to recharge then used it again, and that worked. I also blew up the four antenna relays, and that worked. I know these use the p3 trap variable, which is counted down in this function.

The trap case gets called continously on most levels; on some not at all. I haven't seen any calls of the fixture case.

But because of the missing break; the trap case was falling through to the fixture case and replacing the pointer, then counting that down.

Since I can't understand what's going on here, I'm closing this.

donnierussellii commented 5 years ago

Unless this is ever true (I haven't seen it so): if ((p3 < 0x1000) && (p3 > 0)) (*p)--; the missing break; is irrelevant.