e = new(info_player_deathmatch); // safeguard against player joining
- this.classname = "worldspawn"; // safeguard against various stuff ;)
+ // assign reflectively to avoid "assignment to world" warning
+ for (int i = 0, n = numentityfields(); i < n; ++i) {
+ string k = entityfieldname(i);
+ if (k == "classname") {
+ // safeguard against various stuff ;)
+ putentityfieldstring(i, this, "worldspawn");
+ break;
+ }
+ }
// needs to be done so early because of the constants they create
static_init();
MapInfo_Shutdown();
}
+STATIC_INIT_EARLY(maxclients)
+{
+ maxclients = 0;
+ for (entity head = nextent(NULL); head; head = nextent(head)) {
+ ++maxclients;
+ }
+}
+
void Map_MarkAsRecent(string m);
float world_already_spawned;
void Nagger_Init();
cvar_changes_init(); // do this very early now so it REALLY matches the server config
- maxclients = 0;
- for (entity head = nextent(NULL); head; head = nextent(head))
- {
- ++maxclients;
- }
-
// needs to be done so early because of the constants they create
static_init();