Skip to content

Replace NAMEKEY strings with defines #373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 119 additions & 0 deletions Generals/Code/GameEngine/Include/Common/_DEFINES/NameKeys.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
// TheSuperHackers @refactor @ShizCalev 04/05/2025 Switching a lot of strings to defines, first up: namekeys.

/*
** Command & Conquer Generals(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

////////////////////////////////////////////////////////////////////////////////
// //
// (c) 2001-2003 Electronic Arts Inc. //
// //
////////////////////////////////////////////////////////////////////////////////

// This file contains various namekey strings.

// Factions
#define NAMEKEY_FactionAmerica "FactionAmerica"
#define NAMEKEY_FactionAmericaAirForce "FactionAmericaAirForce"
#define NAMEKEY_FactionAmericaChooseAGeneral "FactionAmericaChooseAGeneral"
#define NAMEKEY_FactionAmericaSpecialForces "FactionAmericaSpecialForces"
#define NAMEKEY_FactionAmericaTankCommand "FactionAmericaTankCommand"
#define NAMEKEY_FactionChina "FactionChina"
#define NAMEKEY_FactionChinaChooseAGeneral "FactionChinaChooseAGeneral"
#define NAMEKEY_FactionChinaRedArmy "FactionChinaRedArmy"
#define NAMEKEY_FactionChinaSecretPolice "FactionChinaSecretPolice"
#define NAMEKEY_FactionChinaSpecialWeapons "FactionChinaSpecialWeapons"
#define NAMEKEY_FactionCivilian "FactionCivilian"
#define NAMEKEY_FactionFundamentalist "FactionFundamentalist" //GLA's placeholder name during initial development.
#define NAMEKEY_FactionGLA "FactionGLA"
#define NAMEKEY_FactionGLABiowarCommand "FactionGLABiowarCommand"
#define NAMEKEY_FactionGLAChooseAGeneral "FactionGLAChooseAGeneral"
#define NAMEKEY_FactionGLATerrorCell "FactionGLATerrorCell"
#define NAMEKEY_FactionGLAWarlordCommand "FactionGLAWarlordCommand"
#define NAMEKEY_FactionObserver "FactionObserver"


// Misc
#define NAMEKEY_Bogus "Bogus"
#define NAMEKEY_BoneFXDamage "BoneFXDamage"
#define NAMEKEY_ControlBar.wnd:ButtonPlaceBeacon "ControlBar.wnd:ButtonPlaceBeacon"
#define NAMEKEY_OverchargeBehavior "OverchargeBehavior"
#define NAMEKEY_PlyrCivilian "PlyrCivilian"
#define NAMEKEY_RailroadBehavior "RailroadBehavior"
#define NAMEKEY_SupplyCenterCreate "SupplyCenterCreate"


// Upgrades
#define NAMEKEY_AutoDepositUpdate "AutoDepositUpdate"
#define NAMEKEY_BeaconClientUpdate "BeaconClientUpdate"
#define NAMEKEY_DeliverPayloadAIUpdate "DeliverPayloadAIUpdate"
#define NAMEKEY_DemoTrapUpdate "DemoTrapUpdate"
#define NAMEKEY_FireSpreadUpdate "FireSpreadUpdate"
#define NAMEKEY_FlammableUpdate "FlammableUpdate"
#define NAMEKEY_HackInternetAIUpdate "HackInternetAIUpdate"
#define NAMEKEY_PowerPlantUpdate "PowerPlantUpdate"
#define NAMEKEY_PowerPlantUpgrade "PowerPlantUpgrade"
#define NAMEKEY_RadarUpgrade "RadarUpgrade"
#define NAMEKEY_StealthUpdate "StealthUpdate"
#define NAMEKEY_SupplyCenterDockUpdate "SupplyCenterDockUpdate"
#define NAMEKEY_SupplyWarehouseDockUpdate "SupplyWarehouseDockUpdate"
#define NAMEKEY_SwayClientUpdate "SwayClientUpdate"

// Menus
#define NAMEKEY_PopupLadderSelect.wnd:StaticTextLadderName "PopupLadderSelect.wnd:StaticTextLadderName"
#define NAMEKEY_PopupLadderSelect.wnd:PasswordParent "PopupLadderSelect.wnd:PasswordParent"
#define NAMEKEY_PopupLadderSelect.wnd:PasswordEntry "PopupLadderSelect.wnd:PasswordEntry"
#define NAMEKEY_PopupLadderSelect.wnd:Parent "PopupLadderSelect.wnd:Parent"
#define NAMEKEY_PopupLadderSelect.wnd:ListBoxLadderSelect "PopupLadderSelect.wnd:ListBoxLadderSelect"
#define NAMEKEY_PopupLadderSelect.wnd:ListBoxLadderDetails "PopupLadderSelect.wnd:ListBoxLadderDetails"
#define NAMEKEY_PopupLadderSelect.wnd:ButtonPasswordOk "PopupLadderSelect.wnd:ButtonPasswordOk"
#define NAMEKEY_PopupLadderSelect.wnd:ButtonPasswordCancel "PopupLadderSelect.wnd:ButtonPasswordCancel"
#define NAMEKEY_PopupLadderSelect.wnd:ButtonOk "PopupLadderSelect.wnd:ButtonOk"
#define NAMEKEY_PopupLadderSelect.wnd:ButtonCancel "PopupLadderSelect.wnd:ButtonCancel"
#define NAMEKEY_PopupLadderSelect.wnd:ButtonBadPasswordOk "PopupLadderSelect.wnd:ButtonBadPasswordOk"
#define NAMEKEY_PopupLadderSelect.wnd:BadPasswordParent "PopupLadderSelect.wnd:BadPasswordParent"

#define NAMEKEY_SkirmishGameOptionsMenu.wnd:StaticTextWinsValue "SkirmishGameOptionsMenu.wnd:StaticTextWinsValue"
#define NAMEKEY_SkirmishGameOptionsMenu.wnd:StaticTextStreakValue "SkirmishGameOptionsMenu.wnd:StaticTextStreakValue"
#define NAMEKEY_SkirmishGameOptionsMenu.wnd:StaticTextLossesValue "SkirmishGameOptionsMenu.wnd:StaticTextLossesValue"
#define NAMEKEY_SkirmishGameOptionsMenu.wnd:StaticTextBestStreakValue "SkirmishGameOptionsMenu.wnd:StaticTextBestStreakValue"
#define NAMEKEY_SkirmishGameOptionsMenu.wnd:ListboxInfo "SkirmishGameOptionsMenu.wnd:ListboxInfo"

#define NAMEKEY_WOLWelcomeMenu.wnd:WOLWelcomeMenuParent "WOLWelcomeMenu.wnd:WOLWelcomeMenuParent"
#define NAMEKEY_WOLWelcomeMenu.wnd:StaticTextUSAToday "WOLWelcomeMenu.wnd:StaticTextUSAToday"
#define NAMEKEY_WOLWelcomeMenu.wnd:StaticTextUSALastWeek "WOLWelcomeMenu.wnd:StaticTextUSALastWeek"
#define NAMEKEY_WOLWelcomeMenu.wnd:StaticTextGLAToday "WOLWelcomeMenu.wnd:StaticTextGLAToday"
#define NAMEKEY_WOLWelcomeMenu.wnd:StaticTextGLALastWeek "WOLWelcomeMenu.wnd:StaticTextGLALastWeek"
#define NAMEKEY_WOLWelcomeMenu.wnd:StaticTextChinaToday "WOLWelcomeMenu.wnd:StaticTextChinaToday"
#define NAMEKEY_WOLWelcomeMenu.wnd:StaticTextChinaLastWeek "WOLWelcomeMenu.wnd:StaticTextChinaLastWeek"

#define NAMEKEY_ControlBar.wnd:BackgroundMarker "ControlBar.wnd:BackgroundMarker"
#define NAMEKEY_ControlBar.wnd:ButtonGeneral "ControlBar.wnd:ButtonGeneral"
#define NAMEKEY_ControlBar.wnd:ButtonIdleWorker "ControlBar.wnd:ButtonIdleWorker"
#define NAMEKEY_ControlBar.wnd:ButtonLarge "ControlBar.wnd:ButtonLarge"
#define NAMEKEY_ControlBar.wnd:ButtonOptions "ControlBar.wnd:ButtonOptions"
#define NAMEKEY_ControlBar.wnd:ButtonPlaceBeacon "ControlBar.wnd:ButtonPlaceBeacon"
#define NAMEKEY_ControlBar.wnd:GeneralsExp "ControlBar.wnd:GeneralsExp"
#define NAMEKEY_ControlBar.wnd:MoneyDisplay "ControlBar.wnd:MoneyDisplay"
#define NAMEKEY_ControlBar.wnd:PowerWindow "ControlBar.wnd:PowerWindow"
#define NAMEKEY_ControlBar.wnd:WinUAttack "ControlBar.wnd:WinUAttack"

#define NAMEKEY_NonCommand_UpDown "NonCommand_UpDown"
#define NAMEKEY_NonCommand_Options "NonCommand_Options"
#define NAMEKEY_NonCommand_IdleWorker "NonCommand_IdleWorker"
#define NAMEKEY_NonCommand_GeneralsExperience "NonCommand_GeneralsExperience"
#define NAMEKEY_NonCommand_Beacon "NonCommand_Beacon"
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class BeaconClientUpdateModuleData : public ClientUpdateModuleData
class BeaconClientUpdate : public ClientUpdateModule
{

MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( BeaconClientUpdate, "BeaconClientUpdate" )
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( BeaconClientUpdate, NAMEKEY_BeaconClientUpdate )
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( BeaconClientUpdate, BeaconClientUpdateModuleData );

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Thing;
class SwayClientUpdate : public ClientUpdateModule
{

MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SwayClientUpdate, "SwayClientUpdate" )
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SwayClientUpdate, NAMEKEY_SwayClientUpdate )
MAKE_STANDARD_MODULE_MACRO( SwayClientUpdate );

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class AutoDepositUpdateModuleData : public UpdateModuleData
class AutoDepositUpdate : public UpdateModule
{

MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( AutoDepositUpdate, "AutoDepositUpdate" )
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( AutoDepositUpdate, NAMEKEY_AutoDepositUpdate )
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( AutoDepositUpdate, AutoDepositUpdateModuleData )

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class BoneFXDamage : public DamageModule
{

MAKE_STANDARD_MODULE_MACRO( BoneFXDamage );
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( BoneFXDamage, "BoneFXDamage" )
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( BoneFXDamage, NAMEKEY_BoneFXDamage )

public:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class DeliverPayloadData
//-------------------------------------------------------------------------------------------------
class DeliverPayloadAIUpdate : public AIUpdateInterface
{
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( DeliverPayloadAIUpdate, "DeliverPayloadAIUpdate" )
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( DeliverPayloadAIUpdate, NAMEKEY_DeliverPayloadAIUpdate )
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( DeliverPayloadAIUpdate, DeliverPayloadAIUpdateModuleData )

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class DemoTrapUpdateModuleData : public ModuleData
class DemoTrapUpdate : public UpdateModule
{

MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( DemoTrapUpdate, "DemoTrapUpdate" )
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( DemoTrapUpdate, NAMEKEY_DemoTrapUpdate )
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( DemoTrapUpdate, DemoTrapUpdateModuleData );

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class FireSpreadUpdateModuleData : public UpdateModuleData
class FireSpreadUpdate : public UpdateModule
{

MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( FireSpreadUpdate, "FireSpreadUpdate" )
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( FireSpreadUpdate, NAMEKEY_FireSpreadUpdate )
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( FireSpreadUpdate, FireSpreadUpdateModuleData )

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class FlammableUpdateModuleData : public UpdateModuleData
class FlammableUpdate : public UpdateModule, public DamageModuleInterface
{

MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( FlammableUpdate, "FlammableUpdate" )
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( FlammableUpdate, NAMEKEY_FlammableUpdate )
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( FlammableUpdate, FlammableUpdateModuleData )

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class HackInternetAIInterface
//-------------------------------------------------------------------------------------------------
class HackInternetAIUpdate : public AIUpdateInterface, public HackInternetAIInterface
{
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( HackInternetAIUpdate, "HackInternetAIUpdate" )
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( HackInternetAIUpdate, NAMEKEY_HackInternetAIUpdate )
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( HackInternetAIUpdate, HackInternetAIUpdateModuleData )

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class OverchargeBehavior : public UpdateModule,
public OverchargeBehaviorInterface
{

MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( OverchargeBehavior, "OverchargeBehavior" )
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( OverchargeBehavior, NAMEKEY_OverchargeBehavior )
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( OverchargeBehavior, OverchargeBehaviorModuleData )

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class PowerPlantUpdate : public UpdateModule,
public PowerPlantUpdateInterface
{

MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( PowerPlantUpdate, "PowerPlantUpdate" )
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( PowerPlantUpdate, NAMEKEY_PowerPlantUpdate )
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( PowerPlantUpdate, PowerPlantUpdateModuleData );

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Player;
class PowerPlantUpgrade : public UpgradeModule
{

MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( PowerPlantUpgrade, "PowerPlantUpgrade" )
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( PowerPlantUpgrade, NAMEKEY_PowerPlantUpgrade )
MAKE_STANDARD_MODULE_MACRO( PowerPlantUpgrade );

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class RadarUpgradeModuleData : public UpgradeModuleData
class RadarUpgrade : public UpgradeModule
{

MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( RadarUpgrade, "RadarUpgrade" )
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( RadarUpgrade, NAMEKEY_RadarUpgrade )
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( RadarUpgrade, RadarUpgradeModuleData );

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ struct TrainTrack
class RailroadBehavior : public PhysicsBehavior
{

MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( RailroadBehavior, "RailroadBehavior" )
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( RailroadBehavior, NAMEKEY_RailroadBehavior )
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( RailroadBehavior, RailroadBehaviorModuleData )

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class StealthUpdateModuleData : public UpdateModuleData
class StealthUpdate : public UpdateModule
{

MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( StealthUpdate, "StealthUpdate" )
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( StealthUpdate, NAMEKEY_StealthUpdate )
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( StealthUpdate, StealthUpdateModuleData );

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Thing;
class SupplyCenterCreate : public CreateModule
{

MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SupplyCenterCreate, "SupplyCenterCreate" )
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SupplyCenterCreate, NAMEKEY_SupplyCenterCreate )
MAKE_STANDARD_MODULE_MACRO( SupplyCenterCreate )

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class SupplyCenterDockUpdateModuleData : public DockUpdateModuleData
class SupplyCenterDockUpdate : public DockUpdate
{

MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SupplyCenterDockUpdate, "SupplyCenterDockUpdate" )
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SupplyCenterDockUpdate, NAMEKEY_SupplyCenterDockUpdate )
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( SupplyCenterDockUpdate, SupplyCenterDockUpdateModuleData )

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SupplyWarehouseDockUpdateModuleData : public DockUpdateModuleData
class SupplyWarehouseDockUpdate : public DockUpdate
{

MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SupplyWarehouseDockUpdate, "SupplyWarehouseDockUpdate" )
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SupplyWarehouseDockUpdate, NAMEKEY_SupplyWarehouseDockUpdate )
MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( SupplyWarehouseDockUpdate, SupplyWarehouseDockUpdateModuleData )

public:
Expand Down
1 change: 1 addition & 0 deletions Generals/Code/GameEngine/Include/Precompiled/PreRTS.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class STLSpecialAlloc;
//------------------------------------------------------------------------------------ RTS Includes
// Icky. These have to be in this order.
#include "Lib/Basetype.h"
#include "Common/_DEFINES/NameKeys.h" // TheSuperHackers @refactor @ShizCalev 04/05/2025 Switching a lot of strings to defines, first up: namekeys.
#include "Common/STLTypedefs.h"
#include "Common/Errors.h"
#include "Common/Debug.h"
Expand Down
6 changes: 3 additions & 3 deletions Generals/Code/GameEngine/Source/Common/RTS/ActionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,15 @@ Bool ActionManager::canTransferSuppliesAt( const Object *obj, const Object *tran
return FALSE;

// If it is a warehouse, it must have boxes left and not be an enemy
static const NameKeyType key_warehouseUpdate = NAMEKEY("SupplyWarehouseDockUpdate");
static const NameKeyType key_warehouseUpdate = NAMEKEY(NAMEKEY_SupplyWarehouseDockUpdate);
SupplyWarehouseDockUpdate *warehouseModule = (SupplyWarehouseDockUpdate*)transferDest->findUpdateModule( key_warehouseUpdate );
if( warehouseModule )
if( warehouseModule->getBoxesStored() == 0 || transferDest->getRelationship( obj ) == ENEMIES )
return FALSE;

// if it is a supply center, I must have boxes, and must be controlled by the same player
// (not merely an ally... otherwise you may find yourself funding your allies. ick.)
static const NameKeyType key_centerUpdate = NAMEKEY("SupplyCenterDockUpdate");
static const NameKeyType key_centerUpdate = NAMEKEY(NAMEKEY_SupplyCenterDockUpdate);
SupplyCenterDockUpdate *centerModule = (SupplyCenterDockUpdate*)transferDest->findUpdateModule( key_centerUpdate );
if( centerModule )
if( supplyTruck->getNumberBoxes() == 0 || transferDest->getControllingPlayer() != obj->getControllingPlayer() )
Expand Down Expand Up @@ -1548,7 +1548,7 @@ Bool ActionManager::canDoSpecialPowerAtObject( const Object *obj, const Object *
{
//Don't allow it to disguise as a train -- they don't have KINDOF_TRAIN yet, but
//if added, please change this code so it'll be faster!
static const NameKeyType key = NAMEKEY( "RailroadBehavior" );
static const NameKeyType key = NAMEKEY( NAMEKEY_RailroadBehavior );
RailroadBehavior *rBehavior = (RailroadBehavior*)target->findUpdateModule( key );
if( !rBehavior )
{
Expand Down
6 changes: 3 additions & 3 deletions Generals/Code/GameEngine/Source/Common/RTS/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ void Player::becomingTeamMember(Object *obj, Bool yes)
// if so, award the cash bonus
if(this != ThePlayerList->getNeutralPlayer() && yes)
{
NameKeyType key_AutoDepositUpdate = NAMEKEY("AutoDepositUpdate");
NameKeyType key_AutoDepositUpdate = NAMEKEY(NAMEKEY_AutoDepositUpdate);
AutoDepositUpdate *adu = (AutoDepositUpdate *)obj->findUpdateModule(key_AutoDepositUpdate);
if (adu != NULL) {
adu->awardInitialCaptureBonus( this );
Expand Down Expand Up @@ -1107,7 +1107,7 @@ void Player::becomingLocalPlayer(Bool yes)
Drawable *draw = object->getDrawable();
if( draw )
{
static NameKeyType key_StealthUpdate = NAMEKEY( "StealthUpdate" );
static NameKeyType key_StealthUpdate = NAMEKEY( NAMEKEY_StealthUpdate );
StealthUpdate *update = (StealthUpdate*)object->findUpdateModule( key_StealthUpdate );
if( update && update->isDisguised() )
{
Expand Down Expand Up @@ -1737,7 +1737,7 @@ void Player::killPlayer(void)
}
else
{
TheControlBar->setControlBarSchemeByPlayerTemplate(ThePlayerTemplateStore->findPlayerTemplate(NAMEKEY("FactionObserver")));
TheControlBar->setControlBarSchemeByPlayerTemplate(ThePlayerTemplateStore->findPlayerTemplate(NAMEKEY(NAMEKEY_FactionObserver)));
}
}

Expand Down
34 changes: 17 additions & 17 deletions Generals/Code/GameEngine/Source/Common/RTS/PlayerTemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,23 +278,23 @@ void PlayerTemplateStore::update()
const PlayerTemplate* PlayerTemplateStore::findPlayerTemplate(NameKeyType namekey) const
{
// begin ugly, hokey code to quietly load old maps...
static NameKeyType a0 = NAMEKEY("FactionAmerica");
static NameKeyType a1 = NAMEKEY("FactionAmericaChooseAGeneral");
static NameKeyType a2 = NAMEKEY("FactionAmericaTankCommand");
static NameKeyType a3 = NAMEKEY("FactionAmericaSpecialForces");
static NameKeyType a4 = NAMEKEY("FactionAmericaAirForce");

static NameKeyType c0 = NAMEKEY("FactionChina");
static NameKeyType c1 = NAMEKEY("FactionChinaChooseAGeneral");
static NameKeyType c2 = NAMEKEY("FactionChinaRedArmy");
static NameKeyType c3 = NAMEKEY("FactionChinaSpecialWeapons");
static NameKeyType c4 = NAMEKEY("FactionChinaSecretPolice");

static NameKeyType g0 = NAMEKEY("FactionGLA");
static NameKeyType g1 = NAMEKEY("FactionGLAChooseAGeneral");
static NameKeyType g2 = NAMEKEY("FactionGLATerrorCell");
static NameKeyType g3 = NAMEKEY("FactionGLABiowarCommand");
static NameKeyType g4 = NAMEKEY("FactionGLAWarlordCommand");
static NameKeyType a0 = NAMEKEY(NAMEKEY_FactionAmerica);
static NameKeyType a1 = NAMEKEY(NAMEKEY_FactionAmericaChooseAGeneral);
static NameKeyType a2 = NAMEKEY(NAMEKEY_FactionAmericaTankCommand);
static NameKeyType a3 = NAMEKEY(NAMEKEY_FactionAmericaSpecialForces);
static NameKeyType a4 = NAMEKEY(NAMEKEY_FactionAmericaAirForce);

static NameKeyType c0 = NAMEKEY(NAMEKEY_FactionChina);
static NameKeyType c1 = NAMEKEY(NAMEKEY_FactionChinaChooseAGeneral);
static NameKeyType c2 = NAMEKEY(NAMEKEY_FactionChinaRedArmy);
static NameKeyType c3 = NAMEKEY(NAMEKEY_FactionChinaSpecialWeapons);
static NameKeyType c4 = NAMEKEY(NAMEKEY_FactionChinaSecretPolice);

static NameKeyType g0 = NAMEKEY(NAMEKEY_FactionGLA);
static NameKeyType g1 = NAMEKEY(NAMEKEY_FactionGLAChooseAGeneral);
static NameKeyType g2 = NAMEKEY(NAMEKEY_FactionGLATerrorCell);
static NameKeyType g3 = NAMEKEY(NAMEKEY_FactionGLABiowarCommand);
static NameKeyType g4 = NAMEKEY(NAMEKEY_FactionGLAWarlordCommand);

if (namekey == a1 || namekey == a2 || namekey == a3 || namekey == a4)
namekey = a0;
Expand Down
Loading