SERVER: Allow misc_model to default to missing_model.mdl

This commit is contained in:
cypress 2024-07-28 11:46:50 -07:00 committed by GitHub
parent 567e99d376
commit 876d627fa4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -257,14 +257,20 @@ void() misc_model_think =
void() misc_model = void() misc_model =
{ {
if (!self.mdl || self.mdl == "") { // NZ:P Edit -- We use .model instead of .mdl, but keep
// NZP: Check for .model instead // compatibility with progs_dump's .mdl
if (!self.model || self.model == "") if (self.mdl != "")
objerror("Model not defined");
} else {
// Convert to .model instead of .mdl
self.model = self.mdl; self.model = self.mdl;
// NZ:P Edit -- No model specified, use our missing/replacement
// model.
if (self.model == "") {
if (cvar("developer))
bprint(PRINT_HIGH, "+ [DEV-INFO]: misc_model without model set. Fix this!\n");
self.model = "models/missing_model.mdl");
} }
// //
// Set default stats. // Set default stats.
@ -398,4 +404,4 @@ void() game_counter =
// Every time its triggered, increment. // Every time its triggered, increment.
self.use = game_counter_increment; self.use = game_counter_increment;
} }