Server: Handle savegames restoring with entityDef awareness
This commit is contained in:
parent
9e6a203a02
commit
a8c4075ff9
1 changed files with 11 additions and 5 deletions
|
@ -692,12 +692,17 @@ SV_PerformLoad(float fh, float entcount, float playerslots)
|
||||||
|
|
||||||
__fullspawndata = fgets(fh);
|
__fullspawndata = fgets(fh);
|
||||||
|
|
||||||
/* call the constructor if one is present, init the default fields */
|
eold = self;
|
||||||
if (isfunction(strcat("spawnfunc_", cname))) {
|
self = e;
|
||||||
e.classname = cname;
|
|
||||||
|
|
||||||
eold = self;
|
/* check for entityDef first */
|
||||||
self = e;
|
if (EntityDef_SpawnClassname(cname)) {
|
||||||
|
e.classname = cname;
|
||||||
|
loadent = (NSEntity)e;
|
||||||
|
self = eold;
|
||||||
|
} else if (isfunction(strcat("spawnfunc_", cname))) {
|
||||||
|
/* call the constructor if one is present, init the default fields */
|
||||||
|
e.classname = cname;
|
||||||
callfunction(strcat("spawnfunc_", cname));
|
callfunction(strcat("spawnfunc_", cname));
|
||||||
e.classname = cname;
|
e.classname = cname;
|
||||||
loadent = (NSEntity)e;
|
loadent = (NSEntity)e;
|
||||||
|
@ -705,6 +710,7 @@ SV_PerformLoad(float fh, float entcount, float playerslots)
|
||||||
} else {
|
} else {
|
||||||
print(sprintf("Could not spawn %s\n", cname));
|
print(sprintf("Could not spawn %s\n", cname));
|
||||||
remove(e);
|
remove(e);
|
||||||
|
self = eold;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else if (argv(0) == "{") {
|
} else if (argv(0) == "{") {
|
||||||
|
|
Loading…
Reference in a new issue