From 2f6f0d8b28d5b946aeec3e03318e6155e2e8ecde Mon Sep 17 00:00:00 2001 From: NovaRain Date: Wed, 30 May 2018 21:07:51 +0800 Subject: [PATCH] Added the description of new metarule2_explosions mode to function notes.txt. Fixed a typo in metarule2_explosions error message. --- artifacts/scripting/sfall function notes.txt | 4 ++++ sfall/Modules/Explosions.cpp | 2 +- sfall/Modules/Scripting/Handlers/Anims.cpp | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/artifacts/scripting/sfall function notes.txt b/artifacts/scripting/sfall function notes.txt index 7c4efebb..b746acc4 100644 --- a/artifacts/scripting/sfall function notes.txt +++ b/artifacts/scripting/sfall function notes.txt @@ -231,6 +231,10 @@ was made as a dirty easy hack to allow dynamically change some explosion paramet > void set_attack_is_explosion_fire - if you call this right before using a weapon with fire damage type, it will produce explosion effects (and radius damage) just like "explosion" type, but all targets will still receive fire damage. +> void set_explosion_radius(grenade, rocket) +- sets a permanent radius of the explosion for grenades and/or rockets. Passing 0 means not changing the corresponding radius. +- changed radius will be reset each time the player reloads the game. + Some utility/math functions are available: diff --git a/sfall/Modules/Explosions.cpp b/sfall/Modules/Explosions.cpp index 1a7386a5..c9b32478 100644 --- a/sfall/Modules/Explosions.cpp +++ b/sfall/Modules/Explosions.cpp @@ -251,7 +251,7 @@ void Explosions::init() { dlogr(" Done", DL_INIT); } - + DWORD tmp; tmp = SimplePatch(0x4A2873, "Misc", "Dynamite_DmgMax", 50, 0, 9999); SimplePatch(0x4A2878, "Misc", "Dynamite_DmgMin", 30, 0, tmp); diff --git a/sfall/Modules/Scripting/Handlers/Anims.cpp b/sfall/Modules/Scripting/Handlers/Anims.cpp index f9093167..3be3cb91 100644 --- a/sfall/Modules/Scripting/Handlers/Anims.cpp +++ b/sfall/Modules/Scripting/Handlers/Anims.cpp @@ -109,9 +109,9 @@ void sf_reg_anim_turn_towards(OpcodeContext& ctx) { void sf_explosions_metarule(OpcodeContext& ctx) { int mode = ctx.arg(0).asInt(), result = ExplosionsMetaruleFunc(mode, ctx.arg(1).asInt(), ctx.arg(2).asInt()); - + if (result == -1) { - ctx.printOpcodeError("ExplosionsMetalure() - mode (%d) is not supported for the function.", mode); + ctx.printOpcodeError("ExplosionsMetarule() - mode (%d) is not supported for the function.", mode); } ctx.setReturn(result); }