Skip to content

Commit

Permalink
Introducing #define npc constants
Browse files Browse the repository at this point in the history
As proposed by AnnieRuru in http://hercules.ws/board/topic/4320-getserverdef/
They're input directly by the server, Haru's idea! (Thank you).
Also introducing the MAX_CHAT_USERS define as requested by AnnieRuru.

Signed-off-by: shennetsind <ind@henn.et>
  • Loading branch information
shennetsind committed Feb 26, 2014
1 parent a5728fd commit 950e3eb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/map/chat.h
Expand Up @@ -10,6 +10,8 @@
struct map_session_data;
struct chat_data;

#define MAX_CHAT_USERS 20

struct chat_data {
struct block_list bl; // data for this map object
char title[CHATROOM_TITLE_SIZE]; // room title
Expand All @@ -21,7 +23,7 @@ struct chat_data {
uint32 zeny; // required zeny to join
uint32 minLvl; // minimum base level to join
uint32 maxLvl; // maximum base level allowed to join
struct map_session_data* usersd[20];
struct map_session_data* usersd[MAX_CHAT_USERS];
struct block_list* owner;
char npc_event[EVENT_NAME_LENGTH];
/* isn't this a waste? there is a enormous overhead, wouldn't something like skill_blockpc_start be better here? [Ind] */
Expand Down
11 changes: 11 additions & 0 deletions src/map/script.c
Expand Up @@ -19063,6 +19063,17 @@ void script_label_add(int key, int pos) {
**/
void script_hardcoded_constants(void) {

/* server defines */
script->set_constant("PACKETVER",PACKETVER,false);
script->set_constant("MAX_LEVEL",MAX_LEVEL,false);
script->set_constant("MAX_STORAGE",MAX_STORAGE,false);
script->set_constant("MAX_GUILD_STORAGE",MAX_GUILD_STORAGE,false);
script->set_constant("MAX_CART",MAX_INVENTORY,false);
script->set_constant("MAX_INVENTORY",MAX_INVENTORY,false);
script->set_constant("MAX_ZENY",MAX_ZENY,false);
script->set_constant("MAX_BG_MEMBERS",MAX_BG_MEMBERS,false);
script->set_constant("MAX_CHAT_USERS",MAX_CHAT_USERS,false);

/* status options */
script->set_constant("Option_Nothing",OPTION_NOTHING,false);
script->set_constant("Option_Sight",OPTION_SIGHT,false);
Expand Down

0 comments on commit 950e3eb

Please sign in to comment.