diff options
-rw-r--r-- | Changelog-Trunk.txt | 4 | ||||
-rw-r--r-- | conf-tmpl/msg_athena.conf | 1 | ||||
-rw-r--r-- | db/const.txt | 1 | ||||
-rw-r--r-- | src/map/chat.c | 6 | ||||
-rw-r--r-- | src/map/map.h | 1 | ||||
-rw-r--r-- | src/map/npc.c | 3 | ||||
-rw-r--r-- | src/map/script.c | 18 |
7 files changed, 29 insertions, 5 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index e5363ac31..f9f05ed27 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/05/30
+ * Added mapflag "nochat" to prevent chatting rooms from being created.
+ [Skotlex]
+ * Corrected some of the sleep checks when the char id does not matches with
+ the char-id expected by the script engine. [Skotlex]
* Cleanup in itemheal related code, fixed the item heal group bonus not
working on Groups beyond 7. [Skotlex]
* Fixed pet's loot not being moved to your inventory on logout. [Skotlex]
diff --git a/conf-tmpl/msg_athena.conf b/conf-tmpl/msg_athena.conf index 95afacdcc..017442b15 100644 --- a/conf-tmpl/msg_athena.conf +++ b/conf-tmpl/msg_athena.conf @@ -290,6 +290,7 @@ 278: (@request): %s
279: @request sent.
280: Invalid pet name.
+281: You can't create chat rooms on this map
// Guild Castles Number
// --------------------
299: ?? Castles
diff --git a/db/const.txt b/db/const.txt index 7d5458156..9e544d450 100644 --- a/db/const.txt +++ b/db/const.txt @@ -132,6 +132,7 @@ mf_jexp 39 mf_bexp 40
mf_novending 41
mf_loadevent 42
+mf_nochat 43
cell_wall 1
cell_water 3
diff --git a/src/map/chat.c b/src/map/chat.c index 311fe1d8e..8ebd54354 100644 --- a/src/map/chat.c +++ b/src/map/chat.c @@ -12,6 +12,7 @@ #include "clif.h"
#include "pc.h"
#include "npc.h"
+#include "atcommand.h"
int chat_triggerevent(struct chat_data *cd);
@@ -27,6 +28,11 @@ int chat_createchat(struct map_session_data *sd,int limit,int pub,char* pass,cha if (sd->chatID)
return 0; //Prevent people abusing the chat system by creating multiple chats, as pointed out by End of Exam. [Skotlex]
+
+ if (map[sd->bl.m].flag.nochat) {
+ clif_displaymessage (sd->fd, msg_txt(281));
+ return 0; //Can't drop items in nodrop mapflag maps.
+ }
pc_stop_walking(sd,1);
cd = (struct chat_data *) aMalloc(sizeof(struct chat_data));
diff --git a/src/map/map.h b/src/map/map.h index da8b1c715..20fe52b45 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -1084,6 +1084,7 @@ struct map_data { unsigned nodrop : 1;
unsigned novending : 1;
unsigned loadevent : 1;
+ unsigned nochat :1;
} flag;
struct point save;
struct npc_data *npc[MAX_NPC_PER_MAP];
diff --git a/src/map/npc.c b/src/map/npc.c index a81a63b23..372851ca6 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2515,6 +2515,9 @@ static int npc_parse_mapflag (char *w1, char *w2, char *w3, char *w4) else if (strcmpi(w3,"loadevent")==0) { // Skotlex
map[m].flag.loadevent=state;
}
+ else if (strcmpi(w3,"nochat")==0) { // Skotlex
+ map[m].flag.nochat=state;
+ }
return 0;
}
diff --git a/src/map/script.c b/src/map/script.c index c442f210f..c666a7728 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -6875,7 +6875,7 @@ enum { MF_NOMEMO,MF_NOTELEPORT,MF_NOSAVE,MF_NOBRANCH,MF_NOPENALTY,MF_NOZENYPENA MF_NOWARP,MF_FREE,MF_NOICEWALL,MF_SNOW,MF_FOG,MF_SAKURA,MF_LEAVES,MF_RAIN, MF_INDOORS,MF_NOGO,MF_CLOUDS,MF_CLOUDS2,MF_FIREWORKS,MF_GVG_CASTLE,MF_GVG_DUNGEON,MF_NIGHTENABLED, MF_NOBASEEXP, MF_NOJOBEXP, MF_NOMOBLOOT, MF_NOMVPLOOT, MF_NORETURN, MF_NOWARPTO, MF_NIGHTMAREDROP, - MF_RESTRICTED, MF_NOCOMMAND, MF_NODROP, MF_JEXP, MF_BEXP, MF_NOVENDING, MF_LOADEVENT }; + MF_RESTRICTED, MF_NOCOMMAND, MF_NODROP, MF_JEXP, MF_BEXP, MF_NOVENDING, MF_LOADEVENT, MF_NOCHAT }; int buildin_setmapflagnosave(struct script_state *st) { @@ -7037,6 +7037,8 @@ int buildin_setmapflag(struct script_state *st) case MF_LOADEVENT: map[m].flag.loadevent=1; break; + case MF_NOCHAT: + map[m].flag.nochat=1; } } @@ -7179,6 +7181,8 @@ int buildin_removemapflag(struct script_state *st) case MF_LOADEVENT: map[m].flag.loadevent=0; break; + case MF_NOCHAT: + map[m].flag.nochat=0; } } @@ -10962,8 +10966,11 @@ int buildin_awake(struct script_state *st) node = node->next; continue; } - if( sd && sd->char_id != tst->sleep.charid ) + if((sd && sd->char_id != tst->sleep.charid) || (tst->rid && !sd)) + { //Cancel Execution + tst->state=END; tst->rid = 0; + } delete_timer(tst->sleep.timer, run_script_timer); node = script_erase_sleepdb(node); @@ -11705,9 +11712,12 @@ int run_script_timer(int tid, unsigned int tick, int id, int data) struct linkdb_node *node = (struct linkdb_node *)sleep_db; struct map_session_data *sd = map_id2sd(st->rid); - if( sd && sd->char_id != id ) { + if((sd && sd->char_id != id) || (st->rid && !sd)) + { //Character mismatch. Cancel execution. st->rid = 0; + st->state = END; } + while( node && st->sleep.timer != -1 ) { if( (int)node->key == st->oid && ((struct script_state *)node->data)->sleep.timer == st->sleep.timer ) { script_erase_sleepdb(node); @@ -11716,8 +11726,6 @@ int run_script_timer(int tid, unsigned int tick, int id, int data) } node = node->next; } - if(st->rid && !sd) - st->state = END; run_script_main(st); return 0; |