set NonSecretCode based on the bitmap for any opened secret doors

rather then forcing applications to set this to a single bitmap. this
results in much nicer looking secret doors that don't randomly flip
bitmaps at all during and after opening.
This commit is contained in:
Gered 2019-11-10 13:54:00 -05:00
parent 6f75f4284a
commit 5c4d854d5c

View file

@ -274,6 +274,9 @@ if (i == 1 && xGridGlobal[xMapPosn] & DOOR_TYPE_SECRET)
// Get grid map position that corresponds with the x wall // Get grid map position that corresponds with the x wall
// position of where the door starts // position of where the door starts
xSecretmPos = xMapPosn; xSecretmPos = xMapPosn;
aeGlobal->NonSecretCode = xGridGlobal[xMapPosn] & 0xff;
if (iLastX > xPlayer) // Door is to the right of player if (iLastX > xPlayer) // Door is to the right of player
{ {
xSecretmPos1 = xMapPosn + 1; xSecretmPos1 = xMapPosn + 1;
@ -301,6 +304,9 @@ if (i == 2 && yGridGlobal[yMapPosn] & DOOR_TYPE_SECRET)
return (DoorCode | POV_DOORLOCKED); return (DoorCode | POV_DOORLOCKED);
ySecretmPos = yMapPosn; ySecretmPos = yMapPosn;
aeGlobal->NonSecretCode = yGridGlobal[yMapPosn] & 0xff;
if (iLastY > yPlayer) if (iLastY > yPlayer)
{ {
LastMapPosn = yMapPosn; LastMapPosn = yMapPosn;