viewing paste Unknown #44917 | C

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
--- C:/Users/Zodiac/Desktop/script.c    Wed Nov 23 04:54:44 2016
+++ F:/rAthena/src/map/script.c Wed Dec 07 15:58:37 2016
@@ -17721,7 +17721,11 @@
    const char *cmd = script_getfuncname(st), *done_label = "";
    uint8 off = 5;
 
-   bl = map_id2bl(script_getnum(st,2));
+   int unit_id = script_getnum(st,2);
+   if(!unit_id)
+       bl = map_id2bl(st->rid);
+   else
+       bl = map_id2bl(unit_id);
 
    if (!bl) {
        ShowError("buildin_unitwalk: Invalid unit with ID '%d'.\n", script_getnum(st,2));
@@ -17763,7 +17767,13 @@
 /// unitkill <unit_id>;
 BUILDIN_FUNC(unitkill)
 {
-   struct block_list* bl = map_id2bl(script_getnum(st,2));
+
+   struct block_list* bl;
+   int unit_id = script_getnum(st,2);
+   if(!unit_id)
+       bl = map_id2bl(st->rid);
+   else
+       bl = map_id2bl(unit_id);
 
    if (bl != NULL)
        status_kill(bl);
 
Viewed 936 times, submitted by Guest.