Page 1 of 1

Auto Draw Sword

Posted: January 24th, 2022, 8:05 pm
by Akruzen
A "bug" in Prince of Persia where the kid decides whether or not to draw sword automatically depending on if you press shift somewhere else or not.
P.S. This is independent of which level you are in. If you manually sheathe your sword and don't leave the screen, the prince will not draw the sword automatically, unless you press shift key.



Any idea why this is happening? This is the case with both the DOS and the SDLPoP version.

Re: Auto Draw Sword

Posted: January 25th, 2022, 3:34 am
by dmitry_s
When you sheathe the sword manually, the "offguard" variable is set.

https://github.com/NagyD/SDLPoP/blob/cd ... 005.c#L990

And there is logic that does not draw the sword when the "offset" variable is set and "Shift" has not been pressed.

https://github.com/NagyD/SDLPoP/blob/cd ... 005.c#L355

The offguard variable should probably be set to 0 when the "can_guard_see_kid" variable is set to 0.

Re: Auto Draw Sword

Posted: January 25th, 2022, 3:42 am
by dmitry_s
Yeah, that fixed the problem in SDLPoP.