Skip to content

Commit 433c527

Browse files
committed
All entities will be considered friendly in spectator mode
1 parent fb4aeff commit 433c527

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[BaseContainerProps(), SCR_BaseContainerCustomTitleEnum(EEditableEntityState, "m_State")]
2+
modded class SCR_FriendlyEditableEntityFilter
3+
{
4+
protected AFM_SpectatorComponent m_pAFM_SpectatorComponent;
5+
6+
override bool CanAdd(SCR_EditableEntityComponent entity)
7+
{
8+
bool canAdd = super.CanAdd(entity);
9+
10+
// Consider all entities as friendly when in spectator mode
11+
return canAdd || (m_pAFM_SpectatorComponent && m_pAFM_SpectatorComponent.IsSpectatorActive());
12+
}
13+
14+
override void EOnEditorActivate()
15+
{
16+
super.EOnEditorActivate();
17+
18+
PlayerController pc = GetGame().GetPlayerController();
19+
m_pAFM_SpectatorComponent = AFM_SpectatorComponent.Cast(pc.FindComponent(AFM_SpectatorComponent));
20+
}
21+
}

addons/HotelPvP/worlds/TestWorld_Arland_Layers/HotelPvP.layer

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ AFM_FactoryPvPGameMode AFM_FactoryPvPGameMode1 : "{AE65065120241660}Prefabs/MP/M
2626
SCR_SpawnPoint : "{4FEA25583D0975F7}Prefabs/MP/Spawning/SpawnPoint_USSR.et" {
2727
coords 1380.512 36.323 2352.694
2828
}
29-
SCR_ChimeraCharacter : "{516BB3588749F92A}Prefabs/Characters/Factions/CIV/Businessman/Character_CIV_Hostage.et" {
29+
SCR_ChimeraCharacter : "{516BB3588749F92A}Prefabs/Characters/Factions/CIV/Character_CIV_Hostage.et" {
3030
coords 1373.921 37.581 2346.078
3131
}
3232
SCR_SpawnPoint : "{5A2220DD0C16958B}Prefabs/MP/Spawning/SpawnPoint_US.et" {

0 commit comments

Comments
 (0)