diff options
author | (no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-01-29 06:36:59 +0000 |
---|---|---|
committer | (no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-01-29 06:36:59 +0000 |
commit | 7f6f823834ec15931921693be1fd519d1e9efb49 (patch) | |
tree | 95be1bfe695d82dfd7a96d5d005373792f2dd3cc | |
parent | 6e9d4a60f5cb561b72a9e0200ef4734826fb44c9 (diff) | |
download | hercules-7f6f823834ec15931921693be1fd519d1e9efb49.tar.gz hercules-7f6f823834ec15931921693be1fd519d1e9efb49.tar.bz2 hercules-7f6f823834ec15931921693be1fd519d1e9efb49.tar.xz hercules-7f6f823834ec15931921693be1fd519d1e9efb49.zip |
* Added a crash check to Safety Wall
* Added some optimisations in clif_parse_MapMove
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1012 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog.txt | 8 | ||||
-rw-r--r-- | src/map/battle.c | 2 | ||||
-rw-r--r-- | src/map/clif.c | 12 |
3 files changed, 15 insertions, 7 deletions
diff --git a/Changelog.txt b/Changelog.txt index 36036db98..d2fff140c 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,10 @@ Date Added +01/29 + * Added a crash check to Safety Wall, thanks to LebrEf[TaVu] / Freya for + pointing it out [celest] + * Added some optimisations in clif_parse_MapMove, by Ilpalazzo-sama [celest] + 01/28 * Fixed a typo that was causing /in to always report failure even when the name was removed from the ignore list [celest] @@ -22,7 +27,8 @@ Date Added * Kick all characters when the char server disconnects from the map server [celest] * Added @changelook command for spriters to test view ID's [celest] - * Added a check to Pneuma to prevent crashing [celest] + * Added a check to Pneuma to prevent crashing, thanks to LebrEf[TaVu]/Freya for + pointing it out [celest] [celest] * Tweaked garbage collection code after feedback from users [SVN 1002: MouseJstr] * Fixed TRADE exploits (it cures proxy hack / vending+trade hack) thanks to Freya [Lupus] diff --git a/src/map/battle.c b/src/map/battle.c index 3be28ecbc..128ede1a8 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -258,7 +258,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i struct skill_unit *unit; unit = map_find_skill_unit_oncell(bl->m,bl->x,bl->y,MG_SAFETYWALL); if (unit) { - if ((--unit->group->val2)<=0) + if (unit->group && (--unit->group->val2)<=0) skill_delunit(unit); damage=0; } else { diff --git a/src/map/clif.c b/src/map/clif.c index f1a1f1ac6..288ac3b28 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -8000,17 +8000,19 @@ int clif_message(struct block_list *bl, char* msg) */ void clif_parse_MapMove(int fd, struct map_session_data *sd) { // /m /mapmove (as @rura GM command) - char output[100]; + char output[30]; // 17+4+4=26, 30 max. char map_name[17]; nullpo_retv(sd); - memset(output, '\0', sizeof(output)); - memset(map_name, '\0', sizeof(map_name)); +// not needed at all as far as sprintf is used // [Ilpalazzo-sama] +// memset(output, '\0', sizeof(output)); +// not needed -- map_name[16]='\0'; will do +// memset(map_name, '\0', sizeof(map_name)); - if ((battle_config.atc_gmonly == 0 || pc_isGM(sd)) && - (pc_isGM(sd) >= get_atcommand_level(AtCommand_MapMove))) { + if (battle_config.atc_gmonly == 0 || (pc_isGM(sd) >= get_atcommand_level(AtCommand_MapMove))) { memcpy(map_name, RFIFOP(fd,2), 16); + map_name[16]='\0'; sprintf(output, "%s %d %d", map_name, RFIFOW(fd,18), RFIFOW(fd,20)); atcommand_rura(fd, sd, "@rura", output); } |