From 876d627fa40cc75fe4ec6b3ead00bb7eceb09fa1 Mon Sep 17 00:00:00 2001 From: cypress Date: Sun, 28 Jul 2024 11:46:50 -0700 Subject: [PATCH] SERVER: Allow misc_model to default to missing_model.mdl --- source/server/entities/map_entities.qc | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/source/server/entities/map_entities.qc b/source/server/entities/map_entities.qc index c083d82..49dcddb 100644 --- a/source/server/entities/map_entities.qc +++ b/source/server/entities/map_entities.qc @@ -257,14 +257,20 @@ void() misc_model_think = void() misc_model = { - if (!self.mdl || self.mdl == "") { - // NZP: Check for .model instead - if (!self.model || self.model == "") - objerror("Model not defined"); - } else { - // Convert to .model instead of .mdl + // NZ:P Edit -- We use .model instead of .mdl, but keep + // compatibility with progs_dump's .mdl + if (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. @@ -398,4 +404,4 @@ void() game_counter = // Every time its triggered, increment. self.use = game_counter_increment; -} \ No newline at end of file +}