diff --git a/artifacts/mods/gl_highlighting.ssl b/artifacts/mods/gl_highlighting.ssl index 5a156efd..1ab40d09 100644 --- a/artifacts/mods/gl_highlighting.ssl +++ b/artifacts/mods/gl_highlighting.ssl @@ -2,7 +2,6 @@ #include "..\scripting\headers\define_extra.h" //#include "..\..\..\!SRC\headers\define.h" -#define it_flags (6) #define CRITTER_IS_DEAD (1) variable highlightKey; @@ -10,7 +9,7 @@ variable highlightContainers; procedure toggle_highlight_object(variable obj, variable color) begin if obj - and (proto_data(obj_pid(obj), it_flags) bwand FLAG_NOHIGHLIGHT) == 0 + and (get_flags(obj) bwand FLAG_NOHIGHLIGHT) == 0 and (color == 0 or not obj_blocking_line(dude_obj, tile_num(obj), BLOCKING_TYPE_SHOOT)) then begin set_outline(obj, color); end diff --git a/artifacts/scripting/headers/sfall.h b/artifacts/scripting/headers/sfall.h index fc26c034..a16466b5 100644 --- a/artifacts/scripting/headers/sfall.h +++ b/artifacts/scripting/headers/sfall.h @@ -207,4 +207,6 @@ #define exec_map_update_scripts sfall_func0("exec_map_update_scripts") #define set_outline(obj, color) sfall_func2("set_outline", obj, color) #define get_outline(obj) sfall_func1("get_outline", obj) +#define set_flags(obj, color) sfall_func2("set_flags", obj, color) +#define get_flags(obj) sfall_func1("get_flags", obj) #define tile_refresh_display sfall_func0("tile_refresh_display") diff --git a/sfall/Modules/Scripting/Handlers/Metarule.cpp b/sfall/Modules/Scripting/Handlers/Metarule.cpp index 5ee6c52c..a977b474 100644 --- a/sfall/Modules/Scripting/Handlers/Metarule.cpp +++ b/sfall/Modules/Scripting/Handlers/Metarule.cpp @@ -126,6 +126,8 @@ static const SfallMetarule metaruleArray[] = { {"exec_map_update_scripts", sf_exec_map_update_scripts, 0, 0}, {"set_outline", sf_set_outline, 2, 2, {ARG_OBJECT, ARG_INT}}, {"get_outline", sf_get_outline, 1, 1, {ARG_OBJECT}}, + {"set_flags", sf_set_flags, 2, 2, {ARG_OBJECT, ARG_INT}}, + {"get_flags", sf_get_flags, 1, 1, {ARG_OBJECT}}, {"tile_refresh_display", sf_tile_refresh_display, 0, 0}, }; diff --git a/sfall/Modules/Scripting/Handlers/Objects.cpp b/sfall/Modules/Scripting/Handlers/Objects.cpp index 396bc16d..6b6f2368 100644 --- a/sfall/Modules/Scripting/Handlers/Objects.cpp +++ b/sfall/Modules/Scripting/Handlers/Objects.cpp @@ -408,5 +408,16 @@ void sf_get_outline(OpcodeContext& ctx) { ctx.setReturn(obj->outline); } +void sf_set_flags(OpcodeContext& ctx) { + auto obj = ctx.arg(0).asObject(); + int flags = ctx.arg(1).asInt(); + obj->flags = flags; +} + +void sf_get_flags(OpcodeContext& ctx) { + auto obj = ctx.arg(0).asObject(); + ctx.setReturn(obj->flags); +} + } } diff --git a/sfall/Modules/Scripting/Handlers/Objects.h b/sfall/Modules/Scripting/Handlers/Objects.h index f29e1883..51b28cf8 100644 --- a/sfall/Modules/Scripting/Handlers/Objects.h +++ b/sfall/Modules/Scripting/Handlers/Objects.h @@ -71,5 +71,9 @@ void sf_set_outline(OpcodeContext&); void sf_get_outline(OpcodeContext&); +void sf_set_flags(OpcodeContext&); + +void sf_get_flags(OpcodeContext&); + } } diff --git a/sfall/main.cpp b/sfall/main.cpp index a3460a8d..8f5ae40f 100644 --- a/sfall/main.cpp +++ b/sfall/main.cpp @@ -38,8 +38,8 @@ #include "Modules\Explosions.h" #include "Modules\FileSystem.h" #include "Modules\Graphics.h" -#include "Modules\HighlightingMod.h" #include "Modules\HookScripts.h" +#include "Modules\HighlightingMod.h" #include "Modules\HeroAppearance.h" #include "Modules\Input.h" #include "Modules\Inventory.h"