MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / player_warp

Function player_warp

TheForceEngine/TFE_DarkForces/player.cpp:3193–3209  ·  view source on GitHub ↗

TFE

Source from the content-addressed store, hash-verified

3191
3192 // TFE
3193 void player_warp(const ConsoleArgList& args)
3194 {
3195 if (args.size() < 4) { return; }
3196 fixed16_16 x = floatToFixed16(TFE_Console::getFloatArg(args[1]));
3197 fixed16_16 y = -floatToFixed16(TFE_Console::getFloatArg(args[2]));
3198 fixed16_16 z = floatToFixed16(TFE_Console::getFloatArg(args[3]));
3199 RSector* sector = sector_which3D(x, y, z);
3200
3201 if (sector)
3202 {
3203 s_playerObject->posWS = { x, y, z };
3204 s_playerPos = s_playerObject->posWS;
3205
3206 sector_addObject(sector, s_playerObject);
3207 s_playerSector = s_playerObject->sector;
3208 }
3209 }
3210
3211 void player_sector(const ConsoleArgList& args)
3212 {

Callers

nothing calls this directly

Calls 5

floatToFixed16Function · 0.85
getFloatArgFunction · 0.85
sector_which3DFunction · 0.85
sector_addObjectFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected