void MapInfo_Cache_Create(); // enable caching
void MapInfo_Cache_Invalidate(); // delete cache if any, but keep enabled
+void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s, float recurse);
+
void MapInfo_ClearTemps(); // call this when done with mapinfo for this frame
void MapInfo_Shutdown(); // call this in the shutdown handler
// the sane way to detect NaN is broken because of a compiler bug
// (works with constants but breaks when assigned to variables)
// use conversion to string instead
-
//float f = e;
//return (e != f);
- return ftos(e) == "-nan";
+
+ // Negative NaN ("-nan") is much more common but plain "nan" can be created by negating *some* -nans so we need to check both.
+ // DP's QCVM and GMQCC's QCVM behave differently - one needs ftos(-(0.0 / 0.0)), the other ftos(-sqrt(-1)).
+ string s = ftos(e);
+ return s == "nan" || s == "-nan";
}
bool isnormal(float e)
{
float CampaignBailout(string s)
{
+#if 0
cvar = cvar_normal;
cvar_string = cvar_string_normal;
cvar_set = cvar_set_normal;
+#endif
cvar_set("g_campaign", "0");
LOG_INFO("^4campaign initialization failed: ", s);
if(autocvar__campaign_testrun)
return 1;
}
+#if 0
string cvar_campaignwrapper_list; // string of format ; var value; var value; var value;
string cvar_string_campaignwrapper(string theCvar)
{
strunzone(s);
//print(cvar_campaignwrapper_list, "\n");
}
+#endif
float Campaign_Invalid()
{
cvar_set("sv_public", "0");
cvar_set("pausable", "1");
+#if 0
cvar_campaignwrapper_list = strzone(strcat("; ", campaign_mutators[0], "; "));
+#else
+ string cvar_campaignwrapper_list = strcat("; ", campaign_mutators[0], "; ");
+ int argc = tokenizebyseparator(cvar_campaignwrapper_list, "; ");
+ if(argc > 0)
+ {
+ for(int j = 0; j < argc; ++j)
+ {
+ string arg = argv(j);
+ if(arg == "") continue;
+ _MapInfo_Parse_Settemp(mapname, MAPINFO_SETTEMP_ACL_USER, 0, arg, 0); // no recursion!
+ }
+ }
+#endif
+#if 0
cvar = cvar_campaignwrapper;
cvar_string = cvar_string_campaignwrapper;
cvar_set = cvar_set_campaignwrapper;
-
cvar_set("g_campaign", "1");
cvar_set("g_dm", "0");
cvar_set("skill", ftos(baseskill));
cvar_set("bot_number", ftos(campaign_bots[0]));
+#else
+ cvar_settemp("g_campaign", "1");
+ cvar_settemp("g_dm", "0");
+ cvar_settemp("skill", ftos(baseskill));
+ cvar_settemp("bot_number", ftos(campaign_bots[0]));
+#endif
MapInfo_SwitchGameType(MapInfo_Type_FromString(campaign_gametype[0]));
// copy sv_gravity cvar, as the engine needs it too (sorry, this will mess