From 1d0e18a186f67844ccd873eabb56ebdaa3f47f11 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Sat, 25 May 2013 13:49:50 -0700 Subject: Switch block_list and subclasses to dumb_ptr Now we're well-defined, since we're actually calling ctors and dtors. Most of this code will not survive long ... --- src/map/npc.hpp | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'src/map/npc.hpp') diff --git a/src/map/npc.hpp b/src/map/npc.hpp index bedca83..5760ca1 100644 --- a/src/map/npc.hpp +++ b/src/map/npc.hpp @@ -6,26 +6,28 @@ #include "../common/timer.t.hpp" +#include "map.hpp" + constexpr int START_NPC_NUM = 110000000; constexpr int WARP_CLASS = 45; constexpr int WARP_DEBUG_CLASS = 722; constexpr int INVISIBLE_CLASS = 32767; -int npc_event_dequeue(struct map_session_data *sd); -int npc_event(struct map_session_data *sd, const char *npcname, int); +int npc_event_dequeue(dumb_ptr sd); +int npc_event(dumb_ptr sd, const char *npcname, int); int npc_timer_event(const char *eventname); // Added by RoVeRT -int npc_command(struct map_session_data *sd, const char *npcname, const char *command); -int npc_touch_areanpc(struct map_session_data *, int, int, int); -int npc_click(struct map_session_data *, int); -int npc_scriptcont(struct map_session_data *, int); -int npc_buysellsel(struct map_session_data *, int, int); -int npc_buylist(struct map_session_data *, int, const uint16_t *); -int npc_selllist(struct map_session_data *, int, const uint16_t *); +int npc_command(dumb_ptr sd, const char *npcname, const char *command); +int npc_touch_areanpc(dumb_ptr, int, int, int); +int npc_click(dumb_ptr, int); +int npc_scriptcont(dumb_ptr, int); +int npc_buysellsel(dumb_ptr, int, int); +int npc_buylist(dumb_ptr, int, const uint16_t *); +int npc_selllist(dumb_ptr, int, const uint16_t *); int npc_parse_warp(const char *w1, const char *w2, const char *w3, const char *w4); int npc_enable(const char *name, bool flag); -struct npc_data *npc_name2id(const char *name); +dumb_ptr npc_name2id(const char *name); int npc_get_new_npc_id(void); @@ -34,12 +36,12 @@ int npc_get_new_npc_id(void); * * \param message The message to speak. If message is NULL, the NPC will not do anything at all. */ -struct npc_data *npc_spawn_text(int m, int x, int y, int class_, const char *name, const char *message); // message is strdup'd within +dumb_ptr npc_spawn_text(int m, int x, int y, int class_, const char *name, const char *message); // message is strdup'd within /** * Uninstalls and frees an NPC */ -void npc_free(struct npc_data *npc); +void npc_free(dumb_ptr npc); void npc_addsrcfile(const char *); void npc_delsrcfile(const char *); @@ -62,10 +64,10 @@ int npc_event_do(const char *name) return npc_event_do_l(name, 0, 0, NULL); } -int npc_timerevent_start(struct npc_data *nd); -int npc_timerevent_stop(struct npc_data *nd); -interval_t npc_gettimerevent_tick(struct npc_data *nd); -int npc_settimerevent_tick(struct npc_data *nd, interval_t newtimer); -int npc_delete(struct npc_data *nd); +int npc_timerevent_start(dumb_ptr nd); +int npc_timerevent_stop(dumb_ptr nd); +interval_t npc_gettimerevent_tick(dumb_ptr nd); +int npc_settimerevent_tick(dumb_ptr nd, interval_t newtimer); +int npc_delete(dumb_ptr nd); #endif // NPC_HPP -- cgit v1.2.3-70-g09d2