Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ServerGameLogic::GetStartSpawnPosition(const wiCharDataFull& loadout, r3dPoint3D* pos, float* dir)
- {
- // if no map assigned yet, or new map, or newly created character (alive == 3)
- if(loadout.GameMapId == 0 || loadout.GameMapId != ginfo_.mapId || loadout.Alive == 3)
- {
- GetSpawnPositionNewPlayer(loadout.GamePos, pos, dir);
- // move spawn pos at radius
- pos->x += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
- pos->z += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
- //r3dOutToLog("new spawn at position %f %f %f\n", pos->x, pos->y, pos->z);
- return;
- }
- // alive at current map
- if(loadout.GameMapId && (loadout.GameMapId == ginfo_.mapId) && loadout.Alive == 1)
- {
- GetSpawnPositionAfterDeath(loadout.GamePos, pos, dir);
- pos->x += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
- pos->z += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
- //r3dOutToLog("alive at position %f %f %f\n", pos->x, pos->y, pos->z);
- return;
- }
- // revived (alive == 2) - spawn to closest spawn point
- if(loadout.GameMapId && loadout.Alive == 2)
- {
- GetSpawnPositionAfterDeath(loadout.GamePos, pos, dir);
- // move spawn pos at radius
- pos->x += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
- pos->z += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
- //r3dOutToLog("revived at position %f %f %f\n", pos->x, pos->y, pos->z);
- return;
- }
- r3dOutToLog("%d %d %d\n", loadout.GameMapId, loadout.Alive, ginfo_.mapId);
- r3d_assert(false && "GetStartSpawnPosition");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement