Skip to content

Commit f81d39d

Browse files
authored
Fixes for TELEPORTER BASIC (#467)
* Fixes for TELEPORTER BASIC - the player ypos and yaw also need to be transformed to the teleporter's values Also re-instate commented out code that changes automap layer after teleporting * (edit comment)
1 parent 051e4df commit f81d39d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

TheForceEngine/TFE_Jedi/InfSystem/infSystem.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <TFE_DarkForces/hud.h>
1111
#include <TFE_DarkForces/agent.h>
1212
#include <TFE_DarkForces/sound.h>
13+
#include <TFE_DarkForces/automap.h>
1314
#include <TFE_FileSystem/paths.h>
1415
#include <TFE_Jedi/Memory/allocator.h>
1516
#include <TFE_Jedi/Level/level.h>
@@ -1050,7 +1051,7 @@ namespace TFE_Jedi
10501051
{
10511052
char* endPtr;
10521053
fixed16_16 dstPosX = floatToFixed16(strtof(s_infArg0, &endPtr));
1053-
fixed16_16 dstPosY = floatToFixed16(strtof(s_infArg1, &endPtr));
1054+
fixed16_16 dstPosY = floatToFixed16(strtof(s_infArg1, &endPtr)); // Note: the sign of the Y coord is not flipped here, therefore negative Y = up
10541055
fixed16_16 dstPosZ = floatToFixed16(strtof(s_infArg2, &endPtr));
10551056
angle14_16 yaw = floatToAngle(strtof(s_infArg3, &endPtr));
10561057

@@ -1678,6 +1679,13 @@ namespace TFE_Jedi
16781679
obj->yaw = teleport->dstAngle[1];
16791680
obj->roll = teleport->dstAngle[2];
16801681
sector_addObject(teleport->target, obj);
1682+
1683+
if (obj->entityFlags & ETFLAG_PLAYER)
1684+
{
1685+
// TFE: these player-state values also need to be transformed (they were not in the original code)
1686+
s_playerYPos = teleport->dstPosition.y;
1687+
s_playerYaw = teleport->dstAngle[1];
1688+
}
16811689
}
16821690
else if (type == TELEPORT_CHUTE)
16831691
{
@@ -1692,7 +1700,7 @@ namespace TFE_Jedi
16921700

16931701
if (obj->entityFlags & ETFLAG_PLAYER)
16941702
{
1695-
// automap_setLayer(obj->sector->layer);
1703+
automap_setLayer(obj->sector->layer); // set the map layer to the target sector's layer
16961704
}
16971705
} // if (obj)
16981706
} // for (s32 i = 0; i < objCount; objList++)

0 commit comments

Comments
 (0)