Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 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. if (ginfo_.eventServer) //Alive on Event Map - Get them to the start pos.
  18. {
  19. GetSpawnPositionNewPlayer(loadout.GamePos, pos, dir);
  20. // move spawn pos at radius
  21. pos->x += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
  22. pos->z += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
  23. return;
  24. }
  25. *pos = loadout.GamePos;
  26. *dir = loadout.GameDir;
  27. //r3dOutToLog("alive at position %f %f %f\n", pos->x, pos->y, pos->z);
  28. return;
  29. }
  30.  
  31. // revived (alive == 2) - spawn to closest spawn point
  32. if(loadout.GameMapId && loadout.Alive == 2)
  33. {
  34. GetSpawnPositionAfterDeath(loadout.GamePos, pos, dir);
  35. // move spawn pos at radius
  36. pos->x += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
  37. pos->z += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
  38. //r3dOutToLog("revived at position %f %f %f\n", pos->x, pos->y, pos->z);
  39. return;
  40. }
  41.  
  42. r3dOutToLog("%d %d %d\n", loadout.GameMapId, loadout.Alive, ginfo_.mapId);
  43. r3d_assert(false && "GetStartSpawnPosition");
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement