Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. void ServerGameLogic::GetStartSpawnPosition(const wiCharDataFull& loadout, r3dPoint3D* pos, float* dir)
  2. {
  3. // if no map assigned yet, or new map, or newly created character (alive == 3)
  4. if(loadout.GameMapId == 0 || loadout.GameMapId != ginfo_.mapId || loadout.Alive == 3)
  5. {
  6. GetSpawnPositionNewPlayer(loadout.GamePos, pos, dir);
  7. // move spawn pos at radius
  8. pos->x += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
  9. pos->z += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
  10. //r3dOutToLog("new spawn at position %f %f %f\n", pos->x, pos->y, pos->z);
  11. return;
  12. }
  13.  
  14. // alive at current map
  15. if(loadout.GameMapId && (loadout.GameMapId == ginfo_.mapId) && loadout.Alive == 1)
  16. {
  17. GetSpawnPositionAfterDeath(loadout.GamePos, pos, dir);
  18. pos->x += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
  19. pos->z += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
  20. //r3dOutToLog("alive at position %f %f %f\n", pos->x, pos->y, pos->z);
  21. return;
  22. }
  23.  
  24. // revived (alive == 2) - spawn to closest spawn point
  25. if(loadout.GameMapId && loadout.Alive == 2)
  26. {
  27. GetSpawnPositionAfterDeath(loadout.GamePos, pos, dir);
  28. // move spawn pos at radius
  29. pos->x += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
  30. pos->z += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
  31. //r3dOutToLog("revived at position %f %f %f\n", pos->x, pos->y, pos->z);
  32. return;
  33. }
  34.  
  35. r3dOutToLog("%d %d %d\n", loadout.GameMapId, loadout.Alive, ginfo_.mapId);
  36. r3d_assert(false && "GetStartSpawnPosition");
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement