From c5c81196bca1239e075ac434343b13f8c2cfc447 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 30 Jan 2016 23:02:59 +0300 Subject: Remove script command countitemcolor. Now it same with countitem. --- src/emap/init.c | 1 - src/emap/script.c | 38 -------------------------------------- src/emap/script.h | 1 - 3 files changed, 40 deletions(-) diff --git a/src/emap/init.c b/src/emap/init.c index 47c823d..757d66c 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -118,7 +118,6 @@ HPExport void plugin_init (void) addScriptCommand("npcstand", "*", npcStand); addScriptCommand("npcwalkto", "ii", npcWalkTo); addScriptCommand("rif", "is*", rif); - addScriptCommand("countitemcolor", "v*", countItemColor); addScriptCommand("misceffect", "i*", miscEffect); addScriptCommand("setmapmask", "si", setMapMask); addScriptCommand("addmapmask", "si", addMapMask); diff --git a/src/emap/script.c b/src/emap/script.c index 6d879ce..a3ede58 100644 --- a/src/emap/script.c +++ b/src/emap/script.c @@ -958,44 +958,6 @@ BUILDIN(rif) return true; } -BUILDIN(countItemColor) -{ - int nameid, i; - int count = 0; - struct item_data* id = NULL; - getSD(); - - if (script_isstringtype(st, 2)) - { - // item name - id = itemdb->search_name(script_getstr(st, 2)); - } - else - { - // item id - id = itemdb->exists(script_getnum(st, 2)); - } - - if (id == NULL) - { - ShowError("buildin_countitem: Invalid item '%s'.\n", script_getstr(st,2)); // returns string, regardless of what it was - script->reportsrc(st); - script_pushint(st,0); - return false; - } - - nameid = id->nameid; - - for(i = 0; i < MAX_INVENTORY; i++) - { - if(sd->status.inventory[i].nameid == nameid) - count += sd->status.inventory[i].amount; - } - - script_pushint(st, count); - return true; -} - BUILDIN(miscEffect) { int type = script_getnum(st, 2); diff --git a/src/emap/script.h b/src/emap/script.h index d91cf9d..51618cb 100644 --- a/src/emap/script.h +++ b/src/emap/script.h @@ -31,7 +31,6 @@ BUILDIN(getq); BUILDIN(setq); BUILDIN(setNpcDir); BUILDIN(rif); -BUILDIN(countItemColor); BUILDIN(miscEffect); BUILDIN(setMapMask); BUILDIN(getMapMask); -- cgit v1.2.3-60-g2f50