[btech-checkins] CVS: btechmux/src/hcode glue.scode.c,1.2.2.14,1.2.2.15 .depend,1.1.1.1,NONE Makefil
Brought to you by:
twouters
|
From: Thomas W. <two...@us...> - 2003-09-30 01:38:39
|
Update of /cvsroot/btech/btechmux/src/hcode
In directory sc8-pr-cvs1:/tmp/cvs-serv2119/src/hcode
Modified Files:
Tag: btmux_1_4-branch
glue.scode.c
Removed Files:
Tag: btmux_1_4-branch
.depend Makefile
Log Message:
Merge with the Bitkeeper repository at
http://btechmux.bkbits.net/btechmux-stable (the 'stable' branch.)
This adds a cleaner build system (no recursive make, for one) and a host of
small features as seen on 3030MUX.
Index: glue.scode.c
===================================================================
RCS file: /cvsroot/btech/btechmux/src/hcode/glue.scode.c,v
retrieving revision 1.2.2.14
retrieving revision 1.2.2.15
diff -C2 -d -r1.2.2.14 -r1.2.2.15
*** glue.scode.c 30 Jul 2002 20:31:56 -0000 1.2.2.14
--- glue.scode.c 30 Sep 2003 01:38:35 -0000 1.2.2.15
***************
*** 19,22 ****
--- 19,23 ----
#include "mech.h"
+ #include "mech.events.h"
#include "glue.h"
#include "extern.h"
***************
*** 41,44 ****
--- 42,47 ----
#include "p.mech.move.h"
#include "p.mech.los.h"
+ #include "p.event.h"
+ #include "p.mech.restrict.h"
extern SpecialObjectStruct SpecialObjects[];
***************
*** 1282,1285 ****
--- 1285,1372 ----
safe_tprintf_str(buff, bufc, "0");
}
+
+ FUNCTION(fun_btaddparts)
+ {
+ /* fargs[0] = mech/map
+ fargs[1] = partname
+ fargs[2] = quantity
+ */
+ int loc;
+ int index = -1, id = 0, brand = 0, count;
+
+ FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED");
+ loc = match_thing(player, fargs[0]);
+ FUNCHECK(!Good_obj(loc), "#-1 INVALID TARGET");
+ FUNCHECK(strlen(fargs[1]) >= MBUF_SIZE, "#-1 PARTNAME TOO LONG");
+ FUNCHECK(!fargs[1], "#-1 NEED PARTNAME");
+ count = atoi(fargs[2]);
+ FUNCHECK(!count, "1");
+ FUNCHECK(!find_matching_short_part(fargs[1], &index, &id, &brand) &&
+ !find_matching_vlong_part(fargs[1], &index, &id, &brand) &&
+ !find_matching_long_part(fargs[1], &index, &id, &brand), "0");
+ found:
+ econ_change_items(loc, id, brand, count);
+ SendEcon(tprintf("#%d added %d %s to #%d", player, count,
+ get_parts_vlong_name(id, brand), loc));
+ safe_tprintf_str(buff, bufc, "1");
+ }
+
+ extern int xlate(char *);
+
+ FUNCTION(fun_btloadmap)
+ {
+ /* fargs[0] = mapobject
+ fargs[1] = mapname
+ fargs[2] = clear or not to clear
+ */
+ int mapdbref;
+ MAP * map;
+
+ FUNCHECK(nfargs < 2 || nfargs > 3,
+ "#-1 BTLOADMAP TAKES 2 OR 3 ARGUMENTS");
+ FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED");
+ mapdbref = match_thing(player, fargs[0]);
+ FUNCHECK(!Good_obj(mapdbref), "#-1 INVALID TARGET");
+ map = getMap(mapdbref);
+ FUNCHECK(!map, "#-1 INVALID TARGET");
+ switch (map_load(map, fargs[1])) {
+ case -1:
+ safe_str("#-1 MAP NOT FOUND", buff, bufc);
+ return;
+ case -2:
+ safe_str("#-1 INVALID MAP", buff, bufc);
+ return;
+ case 0:
+ break;
+ default:
+ safe_str("#-1 UNKNOWN ERROR", buff, bufc);
+ return;
+ }
+ if (nfargs > 2 && xlate(fargs[2]))
+ map_clearmechs(player, (void *)map, "");
+ safe_str("1", buff, bufc);
+ }
+
+ FUNCTION(fun_btloadmech)
+ {
+ /* fargs[0] = mechobject
+ fargs[1] = mechref
+ */
+ int mechdbref;
+ MECH *mech;
+
+ FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED");
+ mechdbref = match_thing(player, fargs[0]);
+ FUNCHECK(!Good_obj(mechdbref), "#-1 INVALID TARGET");
+ mech = getMech(mechdbref);
+ FUNCHECK(!mech, "#-1 INVALID TARGET");
+ if (mech_loadnew(player, mech, fargs[1]) == 1) {
+ event_remove_data((void *)mech);
+ clear_mech_from_LOS(mech);
+ safe_str("1", buff, bufc);
+ } else {
+ safe_str("#-1 UNABLE TO LOAD TEMPLATE", buff, bufc);
+ }
+ }
#endif
--- .depend DELETED ---
--- Makefile DELETED ---
|