1 [
ComponentEditorProps(
category:
"GameScripted/Respawn/Handlers", description:
"Allows the respawn system to utilize spawning on SpawnPoint(s). Requires a SCR_SpawnPointRespawnComponent attached to PlayerController.")]
6 class SCR_SpawnPointSpawnHandlerComponent : SCR_SpawnHandlerComponent
13 super.OnPostInit(owner);
14 m_PlayerSpawnPointManager = SCR_PlayerSpawnPointManagerComponent.Cast(owner.FindComponent(SCR_PlayerSpawnPointManagerComponent));
20 if (!super.ValidateData_S(requestComponent,
data))
36 SCR_PlayerSpawnPoint playerSpawnPoint = SCR_PlayerSpawnPoint.Cast(spawnPoint);
55 spawnPoint.ClearReservationFor_S(requestComponent.GetPlayerId());
73 if (!spawnPoint.CanReserveFor_S(requestComponent.GetPlayerId(), result))
79 return super.CanRequestSpawn_S(requestComponent,
data, result);
85 #ifdef _ENABLE_RESPAWN_LOGS
86 Print(
string.Format(
"%1::PrepareEntity_S(playerId: %2, entity: %3, data: %4)", Type().ToString(),
87 requestComponent.GetPlayerController().GetPlayerId(),
89 data), LogLevel.NORMAL);
94 if (!spawnPoint.PrepareSpawnedEntity_S(requestComponent,
data, entity))
97 return super.PrepareEntity_S(requestComponent, entity,
data);
105 int playerId = requestComponent.GetPlayerId();
108 if (!spawnPoint.ReserveFor_S(playerId))
122 if (!super.CanFinalize_S(requestComponent,
data, entity))
125 return spawnPoint.CanFinalizeSpawn_S(requestComponent,
data, entity);
133 spawnPoint.OnFinalizeSpawnDone_S(requestComponent,
data, entity);
136 spawnPoint.ClearReservationFor_S(requestComponent.GetPlayerId());