if not(isdemo())\r
{\r
if not(calledhooks & HOOK_START)\r
+ {\r
localcmd("\n_cl_hook_gamestart nop;");\r
+ if(g_campaign) // this is a server cvar used in the client code, but g_campaign is always local, so it should be safe\r
+ localcmd("\n_cl_hook_campaign_gamestart nop;");\r
+ }\r
if not(calledhooks & HOOK_END)\r
+ {\r
localcmd("\ncl_hook_gameend;");\r
+ if(g_campaign)\r
+ localcmd("\ncl_hook_campaign_gameend;");\r
+ }\r
}\r
}\r
\r
if not(isdemo())\r
{\r
localcmd("\n_cl_hook_gamestart ", GametypeNameFromType(gametype), ";");\r
+ if(g_campaign)\r
+ localcmd("\n_cl_hook_campaign_gamestart ", GametypeNameFromType(gametype), ";");\r
calledhooks |= HOOK_START;\r
}\r
}\r
strunzone(forcefog);\r
forcefog = strzone(ReadString());\r
\r
+ g_campaign = ReadCoord();\r
+\r
armorblockpercent = ReadByte() / 255.0;\r
\r
g_weaponswitchdelay = ReadByte() / 255.0;\r
if(calledhooks & HOOK_START)\r
{\r
localcmd("\ncl_hook_gameend;");\r
+ if(g_campaign)\r
+ localcmd("\ncl_hook_campaign_gameend;");\r
calledhooks |= HOOK_END;\r
}\r
\r
\r
#define ALPHA_MIN_VISIBLE 0.003\r
\r
+float g_campaign;\r
+\r
float armorblockpercent;\r
float g_weaponswitchdelay;\r
\r
WriteString(MSG_ENTITY, world.fog);\r
else\r
WriteString(MSG_ENTITY, "");\r
+ WriteCoord(MSG_ENTITY, cvar("g_campaign"));\r
WriteByte(MSG_ENTITY, cvar("g_balance_armor_blockpercent") * 255.0);\r
WriteByte(MSG_ENTITY, cvar("g_balance_weaponswitchdelay") * 255.0);\r
\r
CheatInit();\r
\r
localcmd("\n_sv_hook_gamestart ", GetGametype(), ";");\r
+ if(cvar("g_campaign"))\r
+ localcmd("\n_sv_hook_campaign_gamestart ", GetGametype(), ";");\r
\r
world_initialized = 1;\r
}\r
CampaignPreIntermission();\r
\r
localcmd("\nsv_hook_gameend;");\r
+ if(cvar("g_campaign"))\r
+ localcmd("\nsv_hook_campaign_gameend;");\r
}\r
\r
/*\r