When loading an entity from archive, set the model only if the entity allows model to be archived

This commit is contained in:
smallmodel 2023-11-26 19:49:51 +01:00
parent 825df20a72
commit ba1703ebf0
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -5783,8 +5783,13 @@ void Entity::Archive(Archiver& arc)
arc.ArchiveInteger(&spawnflags);
arc.ArchiveString(&model);
if (arc.Loading() && model.length()) {
setModel(model);
if (arc.Loading() && AutoArchiveModel()) {
if (model.length() && model[0] == '*') {
// set the brush model
edict->s.modelindex = atoi(model.c_str() + 1);
} else {
setModel(model);
}
}
arc.ArchiveVector(&mins);