summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-06-20 16:01:54 -0400
committermekolat <mekolat@users.noreply.github.com>2016-06-20 19:37:12 -0400
commit8bbe978e36a55743609741de24973b3a2ea00c5c (patch)
tree9772a1a1124b58dbbebab66253298f573c700824
parent64f9384c639650498995437bc5ecbd1aadd0b8c2 (diff)
downloadevol-hercules-8bbe978e36a55743609741de24973b3a2ea00c5c.tar.gz
evol-hercules-8bbe978e36a55743609741de24973b3a2ea00c5c.tar.bz2
evol-hercules-8bbe978e36a55743609741de24973b3a2ea00c5c.tar.xz
evol-hercules-8bbe978e36a55743609741de24973b3a2ea00c5c.zip
add buildin setfakecells (fake client-side collision)
-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