From ae6dd8b98622e572f6c4b7712199d31cf2f9a4ea Mon Sep 17 00:00:00 2001 From: skotlex Date: Fri, 19 May 2006 16:27:14 +0000 Subject: - Fixed loginlog definition in main.sql, thanks to Tempesta - Likely fixed the mob-skill random picking behaviour causing infinite loops sometimes. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6658 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 3 +++ sql-files/main.sql | 4 ++-- src/map/mob.c | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 0eeaa917e..b6adeb321 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,9 @@ 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/19 + * Fixed loginlog definition in main.sql, thanks to Tempesta [Skotlex] + * Likely fixed the mob-skill random picking behaviour causing infinite + loops sometimes. [Skotlex] * Modified mobskill_use behaviour to pick a random starting point and check skills from that, rather than always checking from first to last. Fixes skills with high priority blocking skills lower down in the list from diff --git a/sql-files/main.sql b/sql-files/main.sql index eb77388fa..28548ba19 100644 --- a/sql-files/main.sql +++ b/sql-files/main.sql @@ -410,8 +410,8 @@ CREATE TABLE `loginlog` ( `ip` char(15) NOT NULL default '', `user` varchar(32) NOT NULL default '', `rcode` tinyint(4) NOT NULL default '0', - `log` varchar(255) NOT NULL default '' - INDEX (`ip`), + `log` varchar(255) NOT NULL default '', + INDEX (`ip`) ) TYPE=MyISAM; -- diff --git a/src/map/mob.c b/src/map/mob.c index bdbab5cf8..e9c60b179 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2570,7 +2570,7 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event) struct mob_skill *ms; struct block_list *fbl = NULL; //Friend bl, which can either be a BL_PC or BL_MOB depending on the situation. [Skotlex] struct mob_data *fmd = NULL; - int i,j; + int i,n; nullpo_retr (0, md); nullpo_retr (0, ms = md->db->skill); @@ -2582,8 +2582,8 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event) return 0; //Skill act delay only affects non-event skills. //Pick a random starting position and loop from that. - j = rand()%md->db->maxskill; - for (i = j+1; i != j; i++) { + i = rand()%md->db->maxskill; + for (n = 0; n < md->db->maxskill; i++, n++) { int c2, flag = 0; if (i == md->db->maxskill) -- cgit v1.2.3-70-g09d2