Shared: CLASSEXPORT macro will now behaver nicer with non-class spawn functions.

This commit is contained in:
Marco Cawthorne 2023-04-15 18:11:43 -07:00
parent 44b78932f4
commit f4cadc74a8
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
2 changed files with 5 additions and 1 deletions

View File

@ -418,6 +418,10 @@ initents(void)
Sound_Precache("player.waterexit");
Sound_Precache("damage_bullet.hit");
Sound_Precache("player.spraylogo");
Sound_Precache("step_wade.left");
Sound_Precache("step_wade.right");
Sound_Precache("step_ladder.left");
Sound_Precache("step_ladder.right");
if (!g_grMode)
Game_InitRules();

View File

@ -102,7 +102,7 @@ string __fullspawndata;
#define BSPVER_RTCW 47
#define BSPVER_RBSP 1
#define CLASSEXPORT(classname,classa) void classname(void) { spawnfunc_##classa(); }
#define CLASSEXPORT(a,b) void a(void) { if (!isfunction(#b)) { self.classname = strcat("spawnfunc_", #b); } else { self.classname = #b; } callfunction(self.classname); }
#define printf(x, ...) print(sprintf(x, ...))