summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/emap/init.c1
-rw-r--r--src/emap/script_buildins.c30
-rw-r--r--src/emap/script_buildins.h1
3 files changed, 32 insertions, 0 deletions
diff --git a/src/emap/init.c b/src/emap/init.c
index 88a6be9..03874de 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -167,6 +167,7 @@ HPExport void plugin_init (void)
addScriptCommand("htinextkey", "i", htiNextKey);
addScriptCommand("hticheck", "i", htiCheck);
addScriptCommand("htidelete", "i", htiDelete);
+ addScriptCommand("setfakecells", "iii??", setFakeCells);
do_init_langs();
diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c
index 28391cf..6a34298 100644
--- a/src/emap/script_buildins.c
+++ b/src/emap/script_buildins.c
@@ -1805,6 +1805,36 @@ BUILDIN(setLook)
return true;
}
+BUILDIN(setFakeCells)
+{
+ const int x1 = script_getnum(st, 2);
+ const int y1 = script_getnum(st, 3);
+ int x2 = x1, y2 = y1, block_type = 0;
+
+ if (script_hasdata(st, 6))
+ {
+ if (script_isinttype(st, 5) && script_isinttype(st, 6))
+ {
+ x2 = script_getnum(st, 4);
+ y2 = script_getnum(st, 5);
+ block_type = script_getnum(st, 6);
+ }
+ else
+ {
+ ShowError("all arguments must be of type int");
+ return false;
+ }
+ }
+ else
+ {
+ block_type = script_getnum(st, 4);
+ }
+
+ getSD();
+ send_setwall_single(sd->fd, sd->bl.m, 0, x1, y1, x2, y2, block_type);
+ return true;
+}
+
#define checkHashTableExists(id) \
if (!htreg->hashtable_exists(id)) \
{ \
diff --git a/src/emap/script_buildins.h b/src/emap/script_buildins.h
index 6eb109b..6baf5a4 100644
--- a/src/emap/script_buildins.h
+++ b/src/emap/script_buildins.h
@@ -81,5 +81,6 @@ BUILDIN(htIterator);
BUILDIN(htiNextKey);
BUILDIN(htiCheck);
BUILDIN(htiDelete);
+BUILDIN(setFakeCells);
#endif // EVOL_MAP_SCRIPT_BUILDINS