Skip to content

Conversation

@xezon
Copy link

@xezon xezon commented Sep 16, 2025

This change mainly does 3 things:

  1. verifies that string lists have expected sizes
  2. fixes the constness of string lists so that no one can write to them
  3. improves the order of "first" enum values so that the proper enum values show in the debugger

Logically nothing changes.

TODO

  • Replicate in Generals

@xezon xezon added Minor Severity: Minor < Major < Critical < Blocker Refactor Edits the code with insignificant behavior changes, is never user facing labels Sep 16, 2025
@xezon
Copy link
Author

xezon commented Sep 16, 2025

Generals targets fail compile until replicated.

@xezon xezon force-pushed the xezon/refactor-string-lists branch from 84b2077 to 7cc3b7d Compare September 17, 2025 09:22
@xezon
Copy link
Author

xezon commented Sep 17, 2025

Rebased and fixed merge conflicts

@xezon xezon force-pushed the xezon/refactor-string-lists branch from 7cc3b7d to ab497c1 Compare September 19, 2025 13:23
Copy link

@Mauller Mauller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall but a few tweaks needed

};

static const char *DistributionTypeNames[];
static const char *const DistributionTypeNames[];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the GameClientRandomVariable and GameLogicRandomVariable classes should be abstracted and combined into a single class in common.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, seems unnecessary to have duplicate implementations. Is beyond the scope of this change however.

Copy link

@Mauller Mauller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@xezon
Copy link
Author

xezon commented Sep 20, 2025

Replicated in Generals with conflicts

D:\Projects\TheSuperHackers\GeneralsGameCode>FOR /F "delims=" %b IN ('git merge-base --fork-point main') DO git diff %b  1>changes.patch

D:\Projects\TheSuperHackers\GeneralsGameCode>git diff 783bdb771ed5be9cb957d6c42770862b6d73ea5d  1>changes.patch

D:\Projects\TheSuperHackers\GeneralsGameCode>git apply -p2 --directory=Generals --reject --whitespace=fix changes.patch
changes.patch:519: trailing whitespace.

Checking patch Generals/GameEngine/Include/Common/AudioEventInfo.h...
error: Generals/GameEngine/Include/Common/AudioEventInfo.h: No such file or directory
Checking patch Generals/GameEngine/Include/GameClient/ClientRandomValue.h...
error: Generals/GameEngine/Include/GameClient/ClientRandomValue.h: No such file or directory
Checking patch Generals/GameEngine/Include/GameLogic/LogicRandomValue.h...
error: Generals/GameEngine/Include/GameLogic/LogicRandomValue.h: No such file or directory
Checking patch Generals/GameEngine/Source/Common/INI/INIAudioEventInfo.cpp...
error: Generals/GameEngine/Source/Common/INI/INIAudioEventInfo.cpp: No such file or directory
Checking patch Generals/GameEngine/Source/Common/RandomValue.cpp...
error: Generals/GameEngine/Source/Common/RandomValue.cpp: No such file or directory
Checking patch Generals/Libraries/Source/WWVegas/WW3D2/rendobj.h...
error: Generals/Libraries/Source/WWVegas/WW3D2/rendobj.h: No such file or directory
Checking patch Generals/Libraries/Source/WWVegas/WWDebug/wwmemlog.cpp...
error: Generals/Libraries/Source/WWVegas/WWDebug/wwmemlog.cpp: No such file or directory
Checking patch Generals/Libraries/Source/WWVegas/WWLib/Except.cpp...
error: Generals/Libraries/Source/WWVegas/WWLib/Except.cpp: No such file or directory
Checking patch Generals/Libraries/Source/WWVegas/WWLib/WWCommon.h...
error: Generals/Libraries/Source/WWVegas/WWLib/WWCommon.h: No such file or directory
Checking patch Generals/Libraries/Source/WWVegas/WWLib/always.h...
error: Generals/Libraries/Source/WWVegas/WWLib/always.h: No such file or directory
Checking patch Generals/Libraries/Source/WWVegas/WWLib/cpudetect.cpp...
error: Generals/Libraries/Source/WWVegas/WWLib/cpudetect.cpp: No such file or directory
Checking patch Generals/Libraries/Source/WWVegas/WWLib/cpudetect.h...
error: Generals/Libraries/Source/WWVegas/WWLib/cpudetect.h: No such file or directory
Checking patch Generals/Libraries/Source/debug/debug_stack.cpp...
error: Generals/Libraries/Source/debug/debug_stack.cpp: No such file or directory
Checking patch Generals/Code/GameEngine/Include/Common/AcademyStats.h...
error: Generals/Code/GameEngine/Include/Common/AcademyStats.h: No such file or directory
Checking patch Generals/Code/GameEngine/Include/Common/BitFlags.h...
Checking patch Generals/Code/GameEngine/Include/Common/GameCommon.h...
Hunk #1 succeeded at 186 (offset -18 lines).
Hunk #2 succeeded at 194 (offset -18 lines).
error: while searching for:
        CMD_FROM_DOZER,                                                 // Special rare command when the dozer originates a command to attack a mine. Mines are not ai-attackable, and it seems deceitful for the dozer to generate a player or script command. jba.
        CMD_DEFAULT_SWITCH_WEAPON,      // Special case: A weapon that can be chosen -- this is the default case (machine gun vs flashbang).

};

//-------------------------------------------------------------------------------------------------

error: patch failed: Generals/Code/GameEngine/Include/Common/GameCommon.h:230
Hunk #4 succeeded at 478 (offset -20 lines).
Checking patch Generals/Code/GameEngine/Include/Common/GameLOD.h...
Checking patch Generals/Code/GameEngine/Include/Common/GameType.h...
Checking patch Generals/Code/GameEngine/Include/Common/Geometry.h...
Checking patch Generals/Code/GameEngine/Include/Common/INI.h...
Checking patch Generals/Code/GameEngine/Include/Common/KindOf.h...
error: while searching for:
enum KindOfType CPP_11(: Int)
{
        KINDOF_INVALID = -1,
        KINDOF_FIRST = 0,
        KINDOF_OBSTACLE = KINDOF_FIRST, ///< an obstacle to land-based pathfinders
        KINDOF_SELECTABLE,                                                      ///< Actually means MOUSE-INTERACTABLE (doesn't mean you can select it!)
        KINDOF_IMMOBILE,                                                                ///< fixed in location
        KINDOF_CAN_ATTACK,                                                      ///< can attack

error: patch failed: Generals/Code/GameEngine/Include/Common/KindOf.h:44
error: while searching for:
        KINDOF_CONSERVATIVE_BUILDING,           ///< Conservative structures aren't considered part of your base for sneak attack boundary calculations...
        KINDOF_IGNORE_DOCKING_BONES,            ///< Structure will not look up docking bones. Patch 1.03 hack.

        KINDOF_COUNT                                                                            // total number of kindofs

};

typedef BitFlags<KINDOF_COUNT>  KindOfMaskType;

error: patch failed: Generals/Code/GameEngine/Include/Common/KindOf.h:171
Checking patch Generals/Code/GameEngine/Include/Common/ModelState.h...
Hunk #1 succeeded at 91 (offset -3 lines).
Hunk #2 succeeded at 212 (offset -28 lines).
Checking patch Generals/Code/GameEngine/Include/Common/Player.h...
Checking patch Generals/Code/GameEngine/Include/Common/Radar.h...
Checking patch Generals/Code/GameEngine/Include/Common/TerrainTypes.h...
Hunk #1 succeeded at 74 (offset -19 lines).
Hunk #2 succeeded at 104 (offset -38 lines).
Checking patch Generals/Code/GameEngine/Include/Common/ThingSort.h...
Checking patch Generals/Code/GameEngine/Include/Common/ThingTemplate.h...
Hunk #1 succeeded at 207 (offset 4 lines).
Hunk #2 succeeded at 215 (offset 4 lines).
Hunk #3 succeeded at 230 (offset 4 lines).
Hunk #4 succeeded at 238 (offset 4 lines).
Checking patch Generals/Code/GameEngine/Include/Common/Upgrade.h...
Hunk #1 succeeded at 151 (offset -1 lines).
Checking patch Generals/Code/GameEngine/Include/GameClient/Anim2D.h...
Checking patch Generals/Code/GameEngine/Include/GameClient/ControlBar.h...
error: while searching for:
        USES_MINE_CLEARING_WEAPONSET= 0x00200000,       // uses the special mine-clearing weaponset, even if not current
        CAN_USE_WAYPOINTS                                               = 0x00400000, // button has option to use a waypoint path
        MUST_BE_STOPPED                                                 = 0x00800000, // Unit must be stopped in order to be able to use button.

        NUM_COMMAND_OPTIONS
};

#ifdef DEFINE_COMMAND_OPTION_NAMES
static const char *TheCommandOptionNames[] =
{
        "NEED_TARGET_ENEMY_OBJECT",
        "NEED_TARGET_NEUTRAL_OBJECT",

error: patch failed: Generals/Code/GameEngine/Include/GameClient/ControlBar.h:102
Hunk #2 succeeded at 212 (offset -8 lines).
Hunk #3 succeeded at 254 (offset -12 lines).
Hunk #4 succeeded at 278 (offset -12 lines).
Checking patch Generals/Code/GameEngine/Include/GameClient/Credits.h...
Checking patch Generals/Code/GameEngine/Include/GameClient/DisconnectMenu.h...
Checking patch Generals/Code/GameEngine/Include/GameClient/Drawable.h...
Hunk #1 succeeded at 81 (offset -1 lines).
Hunk #2 succeeded at 101 (offset -1 lines).
Checking patch Generals/Code/GameEngine/Include/GameClient/EstablishConnectionsMenu.h...
Checking patch Generals/Code/GameEngine/Include/GameClient/Eva.h...
error: while searching for:
{
  EVA_Invalid = -1,

        EVA_FIRST = 0,
        EVA_LowPower = EVA_FIRST,
        EVA_InsufficientFunds,
        EVA_SuperweaponDetected_Own_ParticleCannon,
        EVA_SuperweaponDetected_Own_Nuke,

error: patch failed: Generals/Code/GameEngine/Include/GameClient/Eva.h:42
error: while searching for:
  EVA_SuperweaponLaunched_Enemy_Sneak_Attack,

        EVA_COUNT,
};

extern const char *TheEvaMessageNames[];

//------------------------------------------------------------------------------------ EvaCheckInfo
struct EvaSideSounds

error: patch failed: Generals/Code/GameEngine/Include/GameClient/Eva.h:98
Checking patch Generals/Code/GameEngine/Include/GameClient/GameWindow.h...
Hunk #1 succeeded at 500 (offset -2 lines).
Checking patch Generals/Code/GameEngine/Include/GameClient/GameWindowTransitions.h...
Checking patch Generals/Code/GameEngine/Include/GameClient/Image.h...
Hunk #1 succeeded at 51 (offset -1 lines).
Checking patch Generals/Code/GameEngine/Include/GameClient/InGameUI.h...
Hunk #1 succeeded at 102 (offset -6 lines).
Hunk #2 succeeded at 135 (offset -12 lines).
Checking patch Generals/Code/GameEngine/Include/GameClient/MetaEvent.h...
Checking patch Generals/Code/GameEngine/Include/GameClient/ParticleSys.h...
error: while searching for:

};


//--------------------------------------------------------------------------------------------------------------

#ifdef DEFINE_PARTICLE_SYSTEM_NAMES

/**** NOTE: These MUST be kept in sync with the enumerations below *****/

static const char *ParticleShaderTypeNames[] =
{
        "NONE", "ADDITIVE", "ALPHA", "ALPHA_TEST", "MULTIPLY", NULL
};

static const char *ParticleTypeNames[] =
{
        "NONE", "PARTICLE", "DRAWABLE", "STREAK", "VOLUME_PARTICLE","SMUDGE", NULL
};

static const char *EmissionVelocityTypeNames[] =
{
        "NONE", "ORTHO", "SPHERICAL", "HEMISPHERICAL", "CYLINDRICAL", "OUTWARD", NULL
};

static const char *EmissionVolumeTypeNames[] =
{
        "NONE", "POINT", "LINE", "BOX", "SPHERE", "CYLINDER", NULL
};

//"NONE", "FLUFF", "DEBRIS", "NATURE", "WEAPON", "DAMAGE", "SPECIAL"
static const char *ParticlePriorityNames[] =
{
        "NONE", "WEAPON_EXPLOSION","SCORCHMARK","DUST_TRAIL","BUILDUP","DEBRIS_TRAIL","UNIT_DAMAGE_FX","DEATH_EXPLOSION","SEMI_CONSTANT","CONSTANT","WEAPON_TRAIL","AREA_EFFECT","CRITICAL", "ALWAYS_RENDER", NULL
};

static const char *WindMotionNames[] =
{
        "NONE", "Unused", "PingPong", "Circular", NULL
};

#endif

/**
 * All of the properties of a particle system, used by both ParticleSystemTemplates
 * and ParticleSystem classes.

error: patch failed: Generals/Code/GameEngine/Include/GameClient/ParticleSys.h:244
error: while searching for:

        enum ParticleShaderType
        {
                INVALID_SHADER=0, ADDITIVE, ALPHA, ALPHA_TEST, MULTIPLY
        }
        m_shaderType;
                                ///< how this particle is rendered

        enum ParticleType
        {
                INVALID_TYPE=0, PARTICLE, DRAWABLE, STREAK, VOLUME_PARTICLE, SMUDGE      ///< is a particle a 2D-screen-facing particle, or a Drawable, or a Segment in a streak?
        }
        m_particleType;


error: patch failed: Generals/Code/GameEngine/Include/GameClient/ParticleSys.h:304
Hunk #4 succeeded at 376 (offset 48 lines).
Hunk #5 succeeded at 420 (offset 48 lines).
Hunk #6 succeeded at 470 (offset 48 lines).
Hunk #7 succeeded at 489 (offset 48 lines).
Checking patch Generals/Code/GameEngine/Include/GameClient/Shadow.h...
Checking patch Generals/Code/GameEngine/Include/GameClient/ShellHooks.h...
Checking patch Generals/Code/GameEngine/Include/GameClient/TerrainVisual.h...
Hunk #1 succeeded at 47 (offset -125 lines).
Hunk #2 succeeded at 77 (offset -125 lines).
Checking patch Generals/Code/GameEngine/Include/GameLogic/AI.h...
Hunk #1 succeeded at 329 (offset -8 lines).
Hunk #2 succeeded at 337 (offset -10 lines).
Checking patch Generals/Code/GameEngine/Include/GameLogic/Damage.h...
Hunk #1 succeeded at 200 (offset 1 line).
Hunk #2 succeeded at 226 (offset 1 line).
Checking patch Generals/Code/GameEngine/Include/GameLogic/Locomotor.h...
error: while searching for:
        LOCO_WINGS,
        LOCO_CLIMBER,                   // human climber - backs down cliffs.
        LOCO_OTHER,
        LOCO_MOTORCYCLE
};

enum LocomotorPriority CPP_11(: Int)
{
        LOCO_MOVES_BACK=0,                              // In a group, this one moves toward the back
        LOCO_MOVES_MIDDLE=1,                    // In a group, this one stays in the middle
        LOCO_MOVES_FRONT=2                              // In a group, this one moves toward the front of the group
};

#ifdef DEFINE_LOCO_APPEARANCE_NAMES
static const char *TheLocomotorAppearanceNames[] =
{
        "TWO_LEGS",
        "FOUR_WHEELS",

error: patch failed: Generals/Code/GameEngine/Include/GameLogic/Locomotor.h:61
Hunk #2 succeeded at 84 (offset -6 lines).
Hunk #3 succeeded at 97 (offset -6 lines).
Hunk #4 succeeded at 116 (offset -6 lines).
Checking patch Generals/Code/GameEngine/Include/GameLogic/LocomotorSet.h...
Checking patch Generals/Code/GameEngine/Include/GameLogic/Module/AIUpdate.h...
Hunk #1 succeeded at 96 (offset -1 lines).
Hunk #2 succeeded at 109 (offset -1 lines).
Hunk #3 succeeded at 122 (offset -1 lines).
Checking patch Generals/Code/GameEngine/Include/GameLogic/Module/BodyModule.h...
error: while searching for:
        PRESERVE_RATIO,
        ADD_CURRENT_HEALTH_TOO,
        FULLY_HEAL,
};

#ifdef DEFINE_MAXHEALTHCHANGETYPE_NAMES
static const char* TheMaxHealthChangeTypeNames[] =
{
        "SAME_CURRENTHEALTH",
        "PRESERVE_RATIO",

error: patch failed: Generals/Code/GameEngine/Include/GameLogic/Module/BodyModule.h:78
error: while searching for:
        "FULLY_HEAL",
        NULL
};
#endif



error: patch failed: Generals/Code/GameEngine/Include/GameLogic/Module/BodyModule.h:89
Checking patch Generals/Code/GameEngine/Include/GameLogic/Module/DozerAIUpdate.h...
Checking patch Generals/Code/GameEngine/Include/GameLogic/Module/HordeUpdate.h...
Checking patch Generals/Code/GameEngine/Include/GameLogic/Module/OCLSpecialPower.h...
Checking patch Generals/Code/GameEngine/Include/GameLogic/Module/SlowDeathBehavior.h...
Checking patch Generals/Code/GameEngine/Include/GameLogic/Module/SpectreGunshipDeploymentUpdate.h...
error: Generals/Code/GameEngine/Include/GameLogic/Module/SpectreGunshipDeploymentUpdate.h: No such file or directory
Checking patch Generals/Code/GameEngine/Include/GameLogic/Module/StealthUpdate.h...
error: while searching for:
        STEALTH_NOT_WHILE_FIRING_TERTIARY               = 0x00000020,
        STEALTH_ONLY_WITH_BLACK_MARKET                  = 0x00000040,
        STEALTH_NOT_WHILE_TAKING_DAMAGE                 = 0x00000080,
        STEALTH_NOT_WHILE_FIRING_WEAPON                 = (STEALTH_NOT_WHILE_FIRING_PRIMARY | STEALTH_NOT_WHILE_FIRING_SECONDARY | STEALTH_NOT_WHILE_FIRING_TERTIARY),
  STEALTH_NOT_WHILE_RIDERS_ATTACKING  = 0x00000100,
};

#ifdef DEFINE_STEALTHLEVEL_NAMES
static const char *TheStealthLevelNames[] =
{
        "ATTACKING",
        "MOVING",

error: patch failed: Generals/Code/GameEngine/Include/GameLogic/Module/StealthUpdate.h:51
Checking patch Generals/Code/GameEngine/Include/GameLogic/Module/StructureToppleUpdate.h...
Checking patch Generals/Code/GameEngine/Include/GameLogic/Powers.h...
Checking patch Generals/Code/GameEngine/Include/GameLogic/Scripts.h...
Hunk #1 succeeded at 832 (offset -10 lines).
Checking patch Generals/Code/GameEngine/Include/GameLogic/Weapon.h...
error: while searching for:
};

//#ifdef DEFINE_WEAPONAFFECTSMASK_NAMES ; Removed protection so other clases can use these strings... not sure why this was protected in the 1st place
static const char *TheWeaponAffectsMaskNames[] =
{
        "SELF",
        "ALLIES",

error: patch failed: Generals/Code/GameEngine/Include/GameLogic/Weapon.h:119
Hunk #5 succeeded at 208 (offset -5 lines).
error: while searching for:

        NULL
};
#endif

// For WeaponBonusConditionFlags

error: patch failed: Generals/Code/GameEngine/Include/GameLogic/Weapon.h:246
Hunk #7 succeeded at 284 (offset -12 lines).
Hunk #8 succeeded at 293 (offset -12 lines).
Checking patch Generals/Code/GameEngine/Include/GameLogic/WeaponSet.h...
Hunk #1 succeeded at 53 (offset -1 lines).
Hunk #2 succeeded at 61 (offset -1 lines).
Hunk #3 succeeded at 71 (offset -1 lines).
Checking patch Generals/Code/GameEngine/Source/Common/BitFlags.cpp...
Hunk #2 succeeded at 148 (offset -26 lines).
Hunk #3 succeeded at 160 (offset -30 lines).
Checking patch Generals/Code/GameEngine/Source/Common/GameLOD.cpp...
Hunk #1 succeeded at 71 (offset -1 lines).
Hunk #2 succeeded at 116 (offset -2 lines).
Hunk #3 succeeded at 136 (offset -2 lines).
Checking patch Generals/Code/GameEngine/Source/Common/INI/INIWater.cpp...
Checking patch Generals/Code/GameEngine/Source/Common/RTS/AcademyStats.cpp...
error: Generals/Code/GameEngine/Source/Common/RTS/AcademyStats.cpp: No such file or directory
Checking patch Generals/Code/GameEngine/Source/Common/RTS/Player.cpp...
Hunk #1 succeeded at 158 (offset -2 lines).
Checking patch Generals/Code/GameEngine/Source/Common/RTS/SpecialPower.cpp...
Hunk #2 succeeded at 102 (offset -29 lines).
Checking patch Generals/Code/GameEngine/Source/Common/System/DisabledTypes.cpp...
Hunk #2 succeeded at 47 (offset -4 lines).
Checking patch Generals/Code/GameEngine/Source/Common/System/GameCommon.cpp...
Checking patch Generals/Code/GameEngine/Source/Common/System/GameType.cpp...
Checking patch Generals/Code/GameEngine/Source/Common/System/KindOf.cpp...
error: while searching for:

        NULL
};

KindOfMaskType KINDOFMASK_NONE; // inits to all zeroes
KindOfMaskType KINDOFMASK_FS;           // inits to all zeroes

error: patch failed: Generals/Code/GameEngine/Source/Common/System/KindOf.cpp:161
Checking patch Generals/Code/GameEngine/Source/Common/System/ObjectStatusTypes.cpp...
error: while searching for:
        "DEPLOYED",
        NULL
};

ObjectStatusMaskType OBJECT_STATUS_MASK_NONE;   // inits to all zeroes

error: patch failed: Generals/Code/GameEngine/Source/Common/System/ObjectStatusTypes.cpp:82
Checking patch Generals/Code/GameEngine/Source/Common/System/Upgrade.cpp...
Hunk #1 succeeded at 39 (offset 1 line).
Checking patch Generals/Code/GameEngine/Source/GameClient/Drawable.cpp...
error: while searching for:
#define VERY_TRANSPARENT_MATERIAL_PASS_OPACITY (0.001f)
#define MATERIAL_PASS_OPACITY_FADE_SCALAR (0.8f)

static const char *TheDrawableIconNames[] =
{
        "DefaultHeal",
        "StructureHeal",

error: patch failed: Generals/Code/GameEngine/Source/GameClient/Drawable.cpp:89
error: while searching for:
        "CarBomb",
        NULL
};


/**

error: patch failed: Generals/Code/GameEngine/Source/GameClient/Drawable.cpp:111
Checking patch Generals/Code/GameEngine/Source/GameClient/Eva.cpp...
error: while searching for:
        //****************************************************************************
        //Kris: Don't forget to add another handler below -- it's ghey-ly implemented.
        //****************************************************************************

        "EVA_INVALID",
};

//-------------------------------------------------------------------------------------------------
const ShouldPlayFunc Eva::s_shouldPlayFuncs[] =

error: patch failed: Generals/Code/GameEngine/Source/GameClient/Eva.cpp:93
error: while searching for:
  Eva::shouldPlayGenericHandler,
  Eva::shouldPlayGenericHandler,
  Eva::shouldPlayGenericHandler,
        NULL,
};



error: patch failed: Generals/Code/GameEngine/Source/GameClient/Eva.cpp:153
error: while searching for:
//-------------------------------------------------------------------------------------------------
EvaMessage Eva::nameToMessage(const AsciiString& name)
{
  DEBUG_ASSERTCRASH( ARRAY_SIZE( TheEvaMessageNames ) == EVA_COUNT + 1, ("TheEvaMessageNames out of sync" ) );
  DEBUG_ASSERTCRASH( stricmp( TheEvaMessageNames[ EVA_COUNT ], "EVA_INVALID" ) == 0, ("TheEvaMessageNames out of sync" ) );
  DEBUG_ASSERTCRASH( stricmp( TheEvaMessageNames[ EVA_COUNT - 1], "EVA_INVALID" ) != 0, ("TheEvaMessageNames out of sync" ) );

        for (Int i = EVA_FIRST; i < EVA_COUNT; ++i) {
                if (name.compareNoCase(TheEvaMessageNames[i]) == 0) {
                        return (EvaMessage) i;

error: patch failed: Generals/Code/GameEngine/Source/GameClient/Eva.cpp:316
error: while searching for:
//-------------------------------------------------------------------------------------------------
AsciiString Eva::messageToName(EvaMessage message)
{
  DEBUG_ASSERTCRASH( ARRAY_SIZE( TheEvaMessageNames ) == EVA_COUNT + 1, ("TheEvaMessageNames out of sync" ) );
  DEBUG_ASSERTCRASH( stricmp( TheEvaMessageNames[ EVA_COUNT ], "EVA_INVALID" ) == 0, ("TheEvaMessageNames out of sync" ) );
  DEBUG_ASSERTCRASH( stricmp( TheEvaMessageNames[ EVA_COUNT - 1], "EVA_INVALID" ) != 0, ("TheEvaMessageNames out of sync" ) );

  if (message >= EVA_FIRST && message < EVA_COUNT)
                return TheEvaMessageNames[message];


error: patch failed: Generals/Code/GameEngine/Source/GameClient/Eva.cpp:333
error: while searching for:
                return FALSE;
        }

  DEBUG_ASSERTCRASH( ARRAY_SIZE( s_shouldPlayFuncs ) == EVA_COUNT + 1, ("Eva::s_shouldPlayFuncs out of sync" ) );
  DEBUG_ASSERTCRASH( s_shouldPlayFuncs[ EVA_COUNT ] == NULL, ("Eva::s_shouldPlayFuncs out of sync" ) );
  DEBUG_ASSERTCRASH( s_shouldPlayFuncs[ EVA_COUNT - 1] != NULL, ("Eva::s_shouldPlayFuncs out of sync" ) );

        m_messageBeingTested = messageToTest;
        return s_shouldPlayFuncs[messageToTest](m_localPlayer);

error: patch failed: Generals/Code/GameEngine/Source/GameClient/Eva.cpp:415
Checking patch Generals/Code/GameEngine/Source/GameClient/FXList.cpp...
Checking patch Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp...
Hunk #1 succeeded at 165 (offset -1 lines).
Checking patch Generals/Code/GameEngine/Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp...
error: while searching for:
#include "GameClient/GameText.h"
#include "GameNetwork/NetworkInterface.h"

const char *DisconnectMenu::m_playerNameTextControlNames[] = {
        "DisconnectScreen.wnd:StaticPlayer1Name",
        "DisconnectScreen.wnd:StaticPlayer2Name",
        "DisconnectScreen.wnd:StaticPlayer3Name",

error: patch failed: Generals/Code/GameEngine/Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp:34
Hunk #2 succeeded at 46 (offset 1 line).
Hunk #3 succeeded at 57 (offset 1 line).
Hunk #4 succeeded at 68 (offset 1 line).
Hunk #5 succeeded at 79 (offset 1 line).
Checking patch Generals/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp...
Checking patch Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp...
error: while searching for:
        "Brigadier",
        "Commander",
};


static const Image* lookupRankImage(AsciiString side, Int rank)

error: patch failed: Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp:102
Checking patch Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp...
Checking patch Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp...
error: while searching for:
// These strings must be in the same order as they are in their definitions
// (see WIN_STATUS_* enums and GWS_* enums).
//
const char *WindowStatusNames[] = { "ACTIVE", "TOGGLE", "DRAGABLE", "ENABLED", "HIDDEN",
                                                                                                                  "ABOVE", "BELOW", "IMAGE", "TABSTOP", "NOINPUT",
                                                                                                                  "NOFOCUS", "DESTROYED", "BORDER",
                                                                                                                  "SMOOTH_TEXT", "ONE_LINE", "NO_FLUSH", "SEE_THRU",

        "RIGHT_CLICK", "WRAP_CENTERED", "CHECK_LIKE","HOTKEY_TEXT",

        "USE_OVERLAY_STATES", "NOT_READY", "FLASHING", "ALWAYS_COLOR",

        "ON_MOUSE_DOWN",

        NULL };

const char *WindowStyleNames[] = { "PUSHBUTTON",        "RADIOBUTTON",  "CHECKBOX",
                                                                                                                 "VERTSLIDER",  "HORZSLIDER",           "SCROLLLISTBOX",
                                                                                                                 "ENTRYFIELD",  "STATICTEXT",           "PROGRESSBAR",
                                                                                                                 "USER",                                "MOUSETRACK",           "ANIMATED",

error: patch failed: Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp:137
Hunk #2 succeeded at 199 (offset -1 lines).
Hunk #3 succeeded at 225 (offset -1 lines).
Checking patch Generals/Code/GameEngine/Source/GameClient/GameClient.cpp...
Hunk #1 succeeded at 1108 (offset -45 lines).
Checking patch Generals/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp...
Checking patch Generals/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp...
Hunk #1 succeeded at 693 (offset -9 lines).
Checking patch Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/OCLSpecialPower.cpp...
error: while searching for:
        MAX_ADJUST_RADIUS = 500
};

static const char* TheOCLCreateLocTypeNames[] =
{
        "CREATE_AT_EDGE_NEAR_SOURCE",
        "CREATE_AT_EDGE_NEAR_TARGET",

error: patch failed: Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/OCLSpecialPower.cpp:51
Hunk #2 succeeded at 59 (offset -2 lines).
Checking patch Generals/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipDeploymentUpdate.cpp...
error: Generals/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipDeploymentUpdate.cpp: No such file or directory
Checking patch Generals/Code/GameEngine/Source/GameLogic/Object/Update/StructureCollapseUpdate.cpp...
Checking patch Generals/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp...
Hunk #2 succeeded at 73 (offset -8 lines).
Checking patch Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp...
Hunk #1 succeeded at 75 (offset -1 lines).
Hunk #2 succeeded at 116 (offset -1 lines).
Hunk #3 succeeded at 2096 (offset -75 lines).
Hunk #4 succeeded at 2496 (offset -177 lines).
Hunk #5 succeeded at 2508 (offset -177 lines).
Checking patch Generals/Code/GameEngine/Source/GameLogic/System/Damage.cpp...
error: while searching for:
///////////////////////////////////////////////////////////////////////////////////////////////////

template<>
const char* DamageTypeFlags::s_bitNameList[] =
{
        "EXPLOSION",
        "CRUSH",

error: patch failed: Generals/Code/GameEngine/Source/GameLogic/System/Damage.cpp:40
error: while searching for:

        NULL
};

DamageTypeFlags DAMAGE_TYPE_FLAGS_NONE;         // inits to all zeroes
DamageTypeFlags DAMAGE_TYPE_FLAGS_ALL;

error: patch failed: Generals/Code/GameEngine/Source/GameLogic/System/Damage.cpp:83
Checking patch Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp...
error: while searching for:
#endif


      static char *illegalTemplateNames[] =
      {
              "EMPPulseBomb",
              "GLAAngryMobRockProjectileObject",

error: patch failed: Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp:3476
Checking patch Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/Module/W3DModelDraw.h...
Checking patch Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp...
Checking patch Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8caps.cpp...
error: while searching for:
#define DXLOG(n) CapsWorkString.Format n ; CapsLog+=CapsWorkString;
#define COMPACTLOG(n) CapsWorkString.Format n ; CompactLog+=CapsWorkString;

static const char* VendorNames[]={
        "Unknown",
        "NVidia",
        "ATI",

error: patch failed: Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8caps.cpp:50
Hunk #2 succeeded at 67 (offset 4 lines).
Checking patch Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8caps.h...
Applied patch Generals/Code/GameEngine/Include/Common/BitFlags.h cleanly.
Applying patch Generals/Code/GameEngine/Include/Common/GameCommon.h with 1 reject...
Hunk #1 applied cleanly.
Hunk #2 applied cleanly.
Rejected hunk #3.
Hunk #4 applied cleanly.
Applied patch Generals/Code/GameEngine/Include/Common/GameLOD.h cleanly.
Applied patch Generals/Code/GameEngine/Include/Common/GameType.h cleanly.
Applied patch Generals/Code/GameEngine/Include/Common/Geometry.h cleanly.
Applied patch Generals/Code/GameEngine/Include/Common/INI.h cleanly.
Applying patch Generals/Code/GameEngine/Include/Common/KindOf.h with 2 rejects...
Rejected hunk #1.
Rejected hunk #2.
Applied patch Generals/Code/GameEngine/Include/Common/ModelState.h cleanly.
Applied patch Generals/Code/GameEngine/Include/Common/Player.h cleanly.
Applied patch Generals/Code/GameEngine/Include/Common/Radar.h cleanly.
Applied patch Generals/Code/GameEngine/Include/Common/TerrainTypes.h cleanly.
Applied patch Generals/Code/GameEngine/Include/Common/ThingSort.h cleanly.
Applied patch Generals/Code/GameEngine/Include/Common/ThingTemplate.h cleanly.
Applied patch Generals/Code/GameEngine/Include/Common/Upgrade.h cleanly.
Applied patch Generals/Code/GameEngine/Include/GameClient/Anim2D.h cleanly.
Applying patch Generals/Code/GameEngine/Include/GameClient/ControlBar.h with 1 reject...
Rejected hunk #1.
Hunk #2 applied cleanly.
Hunk #3 applied cleanly.
Hunk #4 applied cleanly.
Applied patch Generals/Code/GameEngine/Include/GameClient/Credits.h cleanly.
Applied patch Generals/Code/GameEngine/Include/GameClient/DisconnectMenu.h cleanly.
Applied patch Generals/Code/GameEngine/Include/GameClient/Drawable.h cleanly.
Applied patch Generals/Code/GameEngine/Include/GameClient/EstablishConnectionsMenu.h cleanly.
Applying patch Generals/Code/GameEngine/Include/GameClient/Eva.h with 2 rejects...
Rejected hunk #1.
Rejected hunk #2.
Applied patch Generals/Code/GameEngine/Include/GameClient/GameWindow.h cleanly.
Applied patch Generals/Code/GameEngine/Include/GameClient/GameWindowTransitions.h cleanly.
Applied patch Generals/Code/GameEngine/Include/GameClient/Image.h cleanly.
Applied patch Generals/Code/GameEngine/Include/GameClient/InGameUI.h cleanly.
Applied patch Generals/Code/GameEngine/Include/GameClient/MetaEvent.h cleanly.
Applying patch Generals/Code/GameEngine/Include/GameClient/ParticleSys.h with 2 rejects...
Hunk #1 applied cleanly.
Rejected hunk #2.
Rejected hunk #3.
Hunk #4 applied cleanly.
Hunk #5 applied cleanly.
Hunk #6 applied cleanly.
Hunk #7 applied cleanly.
Applied patch Generals/Code/GameEngine/Include/GameClient/Shadow.h cleanly.
Applied patch Generals/Code/GameEngine/Include/GameClient/ShellHooks.h cleanly.
Applied patch Generals/Code/GameEngine/Include/GameClient/TerrainVisual.h cleanly.
Applied patch Generals/Code/GameEngine/Include/GameLogic/AI.h cleanly.
Applied patch Generals/Code/GameEngine/Include/GameLogic/Damage.h cleanly.
Applying patch Generals/Code/GameEngine/Include/GameLogic/Locomotor.h with 1 reject...
Rejected hunk #1.
Hunk #2 applied cleanly.
Hunk #3 applied cleanly.
Hunk #4 applied cleanly.
Applied patch Generals/Code/GameEngine/Include/GameLogic/LocomotorSet.h cleanly.
Applied patch Generals/Code/GameEngine/Include/GameLogic/Module/AIUpdate.h cleanly.
Applying patch Generals/Code/GameEngine/Include/GameLogic/Module/BodyModule.h with 2 rejects...
Hunk #1 applied cleanly.
Hunk #2 applied cleanly.
Rejected hunk #3.
Rejected hunk #4.
Applied patch Generals/Code/GameEngine/Include/GameLogic/Module/DozerAIUpdate.h cleanly.
Applied patch Generals/Code/GameEngine/Include/GameLogic/Module/HordeUpdate.h cleanly.
Applied patch Generals/Code/GameEngine/Include/GameLogic/Module/OCLSpecialPower.h cleanly.
Applied patch Generals/Code/GameEngine/Include/GameLogic/Module/SlowDeathBehavior.h cleanly.
Applying patch Generals/Code/GameEngine/Include/GameLogic/Module/StealthUpdate.h with 1 reject...
Rejected hunk #1.
Applied patch Generals/Code/GameEngine/Include/GameLogic/Module/StructureToppleUpdate.h cleanly.
Applied patch Generals/Code/GameEngine/Include/GameLogic/Powers.h cleanly.
Applied patch Generals/Code/GameEngine/Include/GameLogic/Scripts.h cleanly.
Applying patch Generals/Code/GameEngine/Include/GameLogic/Weapon.h with 2 rejects...
Hunk #1 applied cleanly.
Hunk #2 applied cleanly.
Rejected hunk #3.
Hunk #4 applied cleanly.
Hunk #5 applied cleanly.
Rejected hunk #6.
Hunk #7 applied cleanly.
Hunk #8 applied cleanly.
Applied patch Generals/Code/GameEngine/Include/GameLogic/WeaponSet.h cleanly.
Applied patch Generals/Code/GameEngine/Source/Common/BitFlags.cpp cleanly.
Applied patch Generals/Code/GameEngine/Source/Common/GameLOD.cpp cleanly.
Applied patch Generals/Code/GameEngine/Source/Common/INI/INIWater.cpp cleanly.
Applied patch Generals/Code/GameEngine/Source/Common/RTS/Player.cpp cleanly.
Applied patch Generals/Code/GameEngine/Source/Common/RTS/SpecialPower.cpp cleanly.
Applied patch Generals/Code/GameEngine/Source/Common/System/DisabledTypes.cpp cleanly.
Applied patch Generals/Code/GameEngine/Source/Common/System/GameCommon.cpp cleanly.
Applied patch Generals/Code/GameEngine/Source/Common/System/GameType.cpp cleanly.
Applying patch Generals/Code/GameEngine/Source/Common/System/KindOf.cpp with 1 reject...
Hunk #1 applied cleanly.
Rejected hunk #2.
Applying patch Generals/Code/GameEngine/Source/Common/System/ObjectStatusTypes.cpp with 1 reject...
Hunk #1 applied cleanly.
Rejected hunk #2.
Applied patch Generals/Code/GameEngine/Source/Common/System/Upgrade.cpp cleanly.
Applying patch Generals/Code/GameEngine/Source/GameClient/Drawable.cpp with 2 rejects...
Rejected hunk #1.
Rejected hunk #2.
Applying patch Generals/Code/GameEngine/Source/GameClient/Eva.cpp with 5 rejects...
Hunk #1 applied cleanly.
Rejected hunk #2.
Rejected hunk #3.
Rejected hunk #4.
Rejected hunk #5.
Rejected hunk #6.
Applied patch Generals/Code/GameEngine/Source/GameClient/FXList.cpp cleanly.
Applied patch Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp cleanly.
Applying patch Generals/Code/GameEngine/Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp with 1 reject...
Rejected hunk #1.
Hunk #2 applied cleanly.
Hunk #3 applied cleanly.
Hunk #4 applied cleanly.
Hunk #5 applied cleanly.
Applied patch Generals/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp cleanly.
Applying patch Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp with 1 reject...
Hunk #1 applied cleanly.
Rejected hunk #2.
Applied patch Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp cleanly.
Applying patch Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp with 1 reject...
Rejected hunk #1.
Hunk #2 applied cleanly.
Hunk #3 applied cleanly.
Applied patch Generals/Code/GameEngine/Source/GameClient/GameClient.cpp cleanly.
Applied patch Generals/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp cleanly.
Applied patch Generals/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp cleanly.
Applying patch Generals/Code/GameEngine/Source/GameLogic/Object/SpecialPower/OCLSpecialPower.cpp with 1 reject...
Rejected hunk #1.
Hunk #2 applied cleanly.
Applied patch Generals/Code/GameEngine/Source/GameLogic/Object/Update/StructureCollapseUpdate.cpp cleanly.
Applied patch Generals/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp cleanly.
Applied patch Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp cleanly.
Applying patch Generals/Code/GameEngine/Source/GameLogic/System/Damage.cpp with 2 rejects...
Rejected hunk #1.
Rejected hunk #2.
Applying patch Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp with 1 reject...
Rejected hunk #1.
Applied patch Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/Module/W3DModelDraw.h cleanly.
Applied patch Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp cleanly.
Applying patch Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8caps.cpp with 1 reject...
Rejected hunk #1.
Hunk #2 applied cleanly.
Applied patch Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8caps.h cleanly.

@xezon
Copy link
Author

xezon commented Sep 20, 2025

While replicating, the static asserts revealed 2 additional discepancies in Generals arrays:

template<>
const char* const ArmorSetFlags::s_bitNameList[] =
{
	"VETERAN",
	"ELITE",
	"HERO",
	"PLAYER_UPGRADE",
	"WEAK_VERSUS_BASEDEFENSES", // <----- This was missing

	NULL
};

static const char *const TheCommandSourceMaskNames[] =
{
	"FROM_PLAYER",
	"FROM_SCRIPT",
	"FROM_AI",
	"FROM_DOZER", // <----- This was missing

	NULL
};

Both are fixed now to make it compile.

@xezon xezon merged commit 8ee3d21 into TheSuperHackers:main Sep 20, 2025
18 checks passed
@xezon xezon deleted the xezon/refactor-string-lists branch September 20, 2025 09:29
fbraz3 pushed a commit to fbraz3/GeneralsX that referenced this pull request Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Minor Severity: Minor < Major < Critical < Blocker Refactor Edits the code with insignificant behavior changes, is never user facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants