From 17ae24e012d29f39d5541fdc107ea8baa256e875 Mon Sep 17 00:00:00 2001 From: s1lentq Date: Thu, 12 Dec 2024 01:31:05 +0700 Subject: [PATCH] fix build --- regamedll/dlls/ammo.cpp | 2 +- regamedll/dlls/game.cpp | 4 ++-- regamedll/dlls/triggers.cpp | 2 -- regamedll/dlls/weapontype.cpp | 2 +- regamedll/dlls/wpn_shared/wpn_m3.cpp | 2 +- regamedll/dlls/wpn_shared/wpn_xm1014.cpp | 2 +- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/regamedll/dlls/ammo.cpp b/regamedll/dlls/ammo.cpp index 1df3622cc..8c264ac78 100644 --- a/regamedll/dlls/ammo.cpp +++ b/regamedll/dlls/ammo.cpp @@ -24,7 +24,7 @@ void CBasePlayerAmmo::Spawn() BOOL CBasePlayerAmmo::AddAmmo(CBaseEntity *pOther) { auto ammoInfo = GetAmmoInfo(pev->classname); - if (pOther->GiveAmmo(ammoInfo->buyClipSize, ammoInfo->ammoName2) == -1) + if (!ammoInfo || pOther->GiveAmmo(ammoInfo->buyClipSize, ammoInfo->ammoName2) == -1) { return FALSE; } diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index 12f63c1a7..5680db82a 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -470,10 +470,10 @@ void EXT_FUNC GameDLLInit() SERVER_COMMAND("exec game_init.cfg\n"); SERVER_EXECUTE(); - Regamedll_Game_Init(); - #endif // REGAMEDLL_ADD + Regamedll_Game_Init(); + Bot_RegisterCVars(); Tutor_RegisterCVars(); Hostage_RegisterCVars(); diff --git a/regamedll/dlls/triggers.cpp b/regamedll/dlls/triggers.cpp index 42e5cbdec..63282c06e 100644 --- a/regamedll/dlls/triggers.cpp +++ b/regamedll/dlls/triggers.cpp @@ -585,7 +585,6 @@ void CTriggerCDAudio::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP PlayTrack(pCaller->edict()); } -#ifdef REGAMEDLL_FIXES const char *g_szMP3trackFileMap[] = { "", "", @@ -617,7 +616,6 @@ const char *g_szMP3trackFileMap[] = "media/Suspense05.mp3", "media/Suspense07.mp3" }; -#endif void PlayCDTrack(edict_t *pClient, int iTrack) { diff --git a/regamedll/dlls/weapontype.cpp b/regamedll/dlls/weapontype.cpp index dd7dc0f82..cc341d7c9 100644 --- a/regamedll/dlls/weapontype.cpp +++ b/regamedll/dlls/weapontype.cpp @@ -545,7 +545,7 @@ WeaponInfoStruct *GetDefaultWeaponInfo(int weaponID) AmmoInfoStruct *GetAmmoInfo(const char *ammoName) { for (auto& info : g_ammoInfo) { - if (!Q_stricmp(info.ammoName1, ammoName)) { + if (info.ammoName1 && !Q_stricmp(info.ammoName1, ammoName)) { return &info; } } diff --git a/regamedll/dlls/wpn_shared/wpn_m3.cpp b/regamedll/dlls/wpn_shared/wpn_m3.cpp index e071c19c5..2f341c951 100644 --- a/regamedll/dlls/wpn_shared/wpn_m3.cpp +++ b/regamedll/dlls/wpn_shared/wpn_m3.cpp @@ -1,6 +1,6 @@ #include "precompiled.h" -const Vector M3_CONE_VECTOR = {0.0675, 0.0675, 0.0}; // special shotgun spreads +const Vector M3_CONE_VECTOR = Vector(0.0675, 0.0675, 0.0); // special shotgun spreads LINK_ENTITY_TO_CLASS(weapon_m3, CM3, CCSM3) diff --git a/regamedll/dlls/wpn_shared/wpn_xm1014.cpp b/regamedll/dlls/wpn_shared/wpn_xm1014.cpp index fb63a0507..c664fe597 100644 --- a/regamedll/dlls/wpn_shared/wpn_xm1014.cpp +++ b/regamedll/dlls/wpn_shared/wpn_xm1014.cpp @@ -1,6 +1,6 @@ #include "precompiled.h" -const Vector XM1014_CONE_VECTOR = {0.0725, 0.0725, 0.0}; // special shotgun spreads +const Vector XM1014_CONE_VECTOR = Vector(0.0725, 0.0725, 0.0); // special shotgun spreads LINK_ENTITY_TO_CLASS(weapon_xm1014, CXM1014, CCSXM1014)