Added "proto_exists" script function

Updated gl_auto_closebox example script.
This commit is contained in:
NovaRain
2021-05-25 12:55:11 +08:00
parent 0b242a770d
commit 1b37ed5d7c
13 changed files with 47 additions and 2 deletions
@@ -13,8 +13,10 @@ Requires sfall 4.2.2/3.8.29 or higher
#include "..\headers\sfall\define_extra.h"
procedure start;
procedure close;
variable lootObject;
variable closeObject;
procedure start begin
if (game_loaded) then begin
@@ -26,8 +28,14 @@ procedure start begin
lootObject := loot_obj;
if (obj_type(lootObject) != OBJ_TYPE_ITEM) then lootObject = 0;
end else if (lootObject andAlso get_sfall_arg_at(1) == INTFACELOOT) then begin
if (get_object_data(lootObject, OBJ_DATA_CUR_FRM) > 1) then obj_close(lootObject);
lootObject = 0;
if (get_object_data(lootObject, OBJ_DATA_CUR_FRM) > 1) then begin
closeObject = lootObject;
call close in 0;
end
end
end
end
procedure close begin
obj_close(closeObject);
end