Skip to content

Commit 212fb66

Browse files
committed
add marineprofile keyvalue to info_player_start
marineprofile(choices) : "Marine" : -1 = [ -1 : "Default" 0 : "Sarge" 1 : "Wildcat" 2 : "Faith" 3 : "Crash" 4 : "Jaeger" 5 : "Wolfe" 6 : "Bastille" 7 : "Vegas" ]
1 parent 0ea8f14 commit 212fb66

13 files changed

Lines changed: 114 additions & 66 deletions

reactivedrop/fgd/base.fgd

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2654,6 +2654,19 @@
26542654
[
26552655
1: "Master (Has priority if multiple info_player_starts exist)" : 0
26562656
]
2657+
2658+
marineprofile(choices) : "Marine" : -1 =
2659+
[
2660+
-1 : "Default"
2661+
0 : "Sarge"
2662+
1 : "Wildcat"
2663+
2 : "Faith"
2664+
3 : "Crash"
2665+
4 : "Jaeger"
2666+
5 : "Wolfe"
2667+
6 : "Bastille"
2668+
7 : "Vegas"
2669+
]
26572670
]
26582671

26592672
@PointClass base(Targetname) size(-1 -1 0, 1 1 1) color(80 150 225) studio("models/editor/overlay_helper.mdl") sphere(fademindist) sphere(fademaxdist) overlay() = info_overlay :
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#include "cbase.h"
2+
#include "info_player_start.h"
3+
4+
// memdbgon must be the last include file in a .cpp file!!!
5+
#include "tier0/memdbgon.h"
6+
7+
BEGIN_DATADESC( CBaseStart )
8+
9+
DEFINE_KEYFIELD( m_nMarineProfile, FIELD_INTEGER, "marineprofile" ),
10+
11+
END_DATADESC()
12+
13+
LINK_ENTITY_TO_CLASS( info_player_start, CBaseStart );
14+
15+
CBaseStart::CBaseStart()
16+
{
17+
m_nMarineProfile = -1;
18+
m_bUsed = false;
19+
}
20+
21+
bool CBaseStart::KeyValue( const char* szKeyName, const char* szValue )
22+
{
23+
if ( FStrEq( szKeyName, "marineprofile" ) )
24+
{
25+
m_nMarineProfile = atoi( szValue );
26+
}
27+
else
28+
return BaseClass::KeyValue( szKeyName, szValue );
29+
30+
return true;
31+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#pragma once
2+
3+
class CBaseStart : public CPointEntity
4+
{
5+
public:
6+
DECLARE_CLASS( CBaseStart, CPointEntity );
7+
8+
CBaseStart();
9+
virtual bool KeyValue( const char* szKeyName, const char* szValue );
10+
11+
DECLARE_DATADESC();
12+
13+
int m_nMarineProfile;
14+
bool m_bUsed;
15+
};

src/game/server/subs.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@ BEGIN_DATADESC( CBaseDMStart )
5858

5959
END_DATADESC()
6060

61-
6261
// These are the new entry points to entities.
6362
LINK_ENTITY_TO_CLASS(info_player_deathmatch,CBaseDMStart);
64-
LINK_ENTITY_TO_CLASS(info_player_start,CPointEntity);
6563
LINK_ENTITY_TO_CLASS(info_landmark,CPointEntity);
6664

6765
bool CBaseDMStart::IsTriggered( CBaseEntity *pEntity )

src/game/server/swarm/asw_arena.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "asw_weapon.h"
99
#include "ai_network.h"
1010
#include "ai_networkmanager.h"
11+
#include "info_player_start.h"
1112

1213
// memdbgon must be the last include file in a .cpp file!!!
1314
#include "tier0/memdbgon.h"
@@ -240,7 +241,7 @@ void CASW_Arena::TeleportPlayersToSpawn()
240241
if ( !ASWGameRules() )
241242
return;
242243

243-
CBaseEntity *pSpot = NULL;
244+
CBaseStart *pSpot = NULL;
244245
CASW_Game_Resource *pGameResource = ASWGameResource();
245246
for (int i=0;i<pGameResource->GetMaxMarineResources();i++)
246247
{
@@ -249,7 +250,7 @@ void CASW_Arena::TeleportPlayersToSpawn()
249250
CASW_Marine *pMarine = pGameResource->GetMarineResource(i)->GetMarineEntity();
250251
if ( pMarine->GetHealth() > 0 )
251252
{
252-
pSpot = ASWGameRules()->GetMarineSpawnPoint( pSpot );
253+
pSpot = ASWGameRules()->GetMarineSpawnPointDM( pSpot );
253254
if ( pSpot )
254255
{
255256
pMarine->Teleport( &pSpot->GetAbsOrigin(), &pSpot->GetAbsAngles(), &vec3_origin );

src/game/server/swarm/asw_player.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ void ASW_DrawAwakeAI()
372372
}
373373
ConVar asw_draw_awake_ai( "asw_draw_awake_ai", "0", FCVAR_CHEAT, "Lists how many of each AI are awake");
374374

375-
CBaseEntity *CASW_Player::spawn_point = NULL;
375+
CBaseStart *CASW_Player::spawn_point = NULL;
376376

377377
CASW_Player::CASW_Player()
378378
{

src/game/server/swarm/asw_player.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "asw_info_message_shared.h"
1515
#include "basemultiplayerplayer.h"
1616
#include "rd_inventory_shared.h"
17+
#include "info_player_start.h"
1718

1819
class CASW_Inhabitable_NPC;
1920
class CASW_Marine;
@@ -306,7 +307,7 @@ class CASW_Player : public CBaseMultiplayerPlayer, public IASWPlayerAnimStateHel
306307
};
307308
CUtlVectorAutoPurge<InventoryCommandData_t *> m_InventoryCommands;
308309

309-
static CBaseEntity *spawn_point;
310+
static CBaseStart *spawn_point;
310311
bool m_bWelcomed;
311312
float m_fLastFragTime;
312313
int m_iKillingSpree;

src/game/server/swarm/asw_tutorial_spawning.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ CASW_TutorialStartPoint *CASW_TutorialStartPoint::GetTutorialStartPoint( int iMa
1818
if ( iMarineSlot < 0 || iMarineSlot >= 8 )
1919
return NULL;
2020

21-
CASW_TutorialStartPoint *pStartEntity = assert_cast<CASW_TutorialStartPoint *>( gEntList.FindEntityByClassname( NULL, "info_tutorial_start" ) );
21+
CASW_TutorialStartPoint *pStartEntity = dynamic_cast<CASW_TutorialStartPoint *>( gEntList.FindEntityByClassname( NULL, "info_tutorial_start" ) );
2222
while ( pStartEntity != NULL )
2323
{
2424
if ( pStartEntity->m_iMarineSlot == iMarineSlot && pStartEntity->m_iSaveStage == GetTutorialSaveStage() )
2525
return pStartEntity;
26-
pStartEntity = assert_cast<CASW_TutorialStartPoint *>( gEntList.FindEntityByClassname( pStartEntity, "info_tutorial_start" ) );
26+
pStartEntity = dynamic_cast<CASW_TutorialStartPoint *>( gEntList.FindEntityByClassname( dynamic_cast<CBaseEntity*>(pStartEntity), "info_tutorial_start" ) );
2727
}
2828

2929
return NULL;

src/game/server/swarm/asw_tutorial_spawning.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#pragma once
55
#endif
66

7+
#include "info_player_start.h"
78

8-
9-
class CASW_TutorialStartPoint : public CPointEntity
9+
class CASW_TutorialStartPoint : public CBaseStart
1010
{
1111
public:
1212
DECLARE_DATADESC();

src/game/server/swarm_sdk_server.vcxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,7 @@ exit /b 0
10751075
<ClCompile Include="inforemarkable.cpp" />
10761076
<ClCompile Include="info_camera_link.cpp" />
10771077
<ClCompile Include="info_overlay_accessor.cpp" />
1078+
<ClCompile Include="info_player_start.cpp" />
10781079
<ClCompile Include="init_factory.cpp">
10791080
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
10801081
</PrecompiledHeader>
@@ -2063,6 +2064,7 @@ exit /b 0
20632064
<ClInclude Include="ilagcompensationmanager.h" />
20642065
<ClInclude Include="inforemarkable.h" />
20652066
<ClInclude Include="info_camera_link.h" />
2067+
<ClInclude Include="info_player_start.h" />
20662068
<ClInclude Include="init_factory.h" />
20672069
<ClInclude Include="iservervehicle.h" />
20682070
<ClInclude Include="items.h" />

0 commit comments

Comments
 (0)