From 4f377896d29b69ba8dce840155476f290640c975 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Sun, 7 Feb 2021 22:02:50 +0000 Subject: [PATCH] fix bug using non-existing "time" variable this was overlooked in da992740367ce36a49c42ed9121777bd9fa246a6 due to the definition of the variable inside that function. this had the effect that the linker found the libc function "time" and linked it to this spot, therefore no linker error happened. this was discovered due to ubuntu 20.04 defaulting to having libc compiled as pie, which made the relocation go boom. --- openborscript.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openborscript.c b/openborscript.c index 422467c..a486f1b 100644 --- a/openborscript.c +++ b/openborscript.c @@ -9901,7 +9901,6 @@ s32 openbor_performattack(ScriptVariant ** varlist, ScriptVariant ** pretvar, in s32 openbor_setidle(ScriptVariant ** varlist, ScriptVariant ** pretvar, int paramCount) { s32 anim, resetable = 0, stalladd; entity *e; - extern unsigned int time; *pretvar = NULL; if(paramCount < 1) @@ -9938,7 +9937,7 @@ s32 openbor_setidle(ScriptVariant ** varlist, ScriptVariant ** pretvar, int para ent_set_anim(e, (int) anim, (int) resetable); if(stalladd > 0) - e->stalltime = time + stalladd; + e->stalltime = borTime + stalladd; return S_OK; -- 2.11.4.GIT