From d73db8c1e80e020ca65867be8a9cc0ed3118132a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 13 Jan 2017 11:48:05 +0100 Subject: [PATCH] - added a 'local' parameter to the A_Log family. - complete "give quakes their own damage type." (was only partially saved.) --- src/g_shared/a_quake.cpp | 2 +- src/p_actionfunctions.cpp | 9 +++++++++ wadsrc/static/zscript/actor.txt | 6 +++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/g_shared/a_quake.cpp b/src/g_shared/a_quake.cpp index 96a932d4f..6835cefeb 100644 --- a/src/g_shared/a_quake.cpp +++ b/src/g_shared/a_quake.cpp @@ -124,7 +124,7 @@ void DEarthquake::Tick () { if (pr_quake() < 50) { - P_DamageMobj (victim, NULL, NULL, pr_quake.HitDice (1), NAME_None); + P_DamageMobj (victim, NULL, NULL, pr_quake.HitDice (1), NAME_Quake); } // Thrust player around DAngle an = victim->Angles.Yaw + pr_quake(); diff --git a/src/p_actionfunctions.cpp b/src/p_actionfunctions.cpp index 32161ed07..b47788212 100644 --- a/src/p_actionfunctions.cpp +++ b/src/p_actionfunctions.cpp @@ -3210,6 +3210,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_Log) { PARAM_SELF_PROLOGUE(AActor); PARAM_STRING(text); + PARAM_BOOL_DEF(local); + + if (local && !self->CheckLocalView(consoleplayer)) return 0; if (text[0] == '$') text = GStrings(&text[1]); FString formatted = strbin1(text); @@ -3227,6 +3230,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_LogInt) { PARAM_SELF_PROLOGUE(AActor); PARAM_INT(num); + PARAM_BOOL_DEF(local); + + if (local && !self->CheckLocalView(consoleplayer)) return 0; Printf("%d\n", num); return 0; } @@ -3241,6 +3247,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_LogFloat) { PARAM_SELF_PROLOGUE(AActor); PARAM_FLOAT(num); + PARAM_BOOL_DEF(local); + + if (local && !self->CheckLocalView(consoleplayer)) return 0; IGNORE_FORMAT_PRE Printf("%H\n", num); IGNORE_FORMAT_POST diff --git a/wadsrc/static/zscript/actor.txt b/wadsrc/static/zscript/actor.txt index 87d4491f0..00d80c49c 100644 --- a/wadsrc/static/zscript/actor.txt +++ b/wadsrc/static/zscript/actor.txt @@ -746,9 +746,9 @@ class Actor : Thinker native native bool A_SpawnItemEx(class itemtype, double xofs = 0, double yofs = 0, double zofs = 0, double xvel = 0, double yvel = 0, double zvel = 0, double angle = 0, int flags = 0, int failchance = 0, int tid=0); native void A_Print(string whattoprint, double time = 0, name fontname = "none"); native void A_PrintBold(string whattoprint, double time = 0, name fontname = "none"); - native void A_Log(string whattoprint); - native void A_LogInt(int whattoprint); - native void A_LogFloat(double whattoprint); + native void A_Log(string whattoprint, bool local = false); + native void A_LogInt(int whattoprint, bool local = false); + native void A_LogFloat(double whattoprint, bool local = false); native void A_SetTranslucent(double alpha, int style = 0); native void A_SetRenderStyle(double alpha, int style); native void A_FadeIn(double reduce = 0.1, int flags = 0);