Toggle navigation
Hercules
Bugtracker archive
Hercules bug tracker archive
Hercules Bug Archives
Core
map_freeblock fix
map_freeblock fix
Warning!
This is the old Hercules bugtracker archive, and may not reflect the current state of Hercules. The current bugtracker is on
GitHub Issues
.
Issue information
Issue ID
#6248
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Jul 15, 2012 22:27
Last Post
Hercules Elf Bot
Jul 16, 2012 18:45
Confirmation
Yes (1)
No (0)
Hercules Elf Bot -
Jul 15, 2012 22:27
Originally posted by [b]Cookie[/b]
Here's a fix for the odd number of blocks causing the map_freeblock_timer(n) error.
In [b]status.c[/b]:
[code]
case SC_BLEEDING:
if (--(sce->val4) >= 0) {
int hp = rnd()%600 + 200;
map_freeblock_lock();
status_fix_damage(NULL, bl, sd||hp<status->hp?hp:status->hp-1, 1);
if( sc->data[type] ) {
if( status->hp == 1 ) break;
sc_timer_next(10000 + tick, status_change_timer, bl->id, data);
}
map_freeblock_unlock();
return 0;
}
break;
[/code]
Should be:
[code]
case SC_BLEEDING:
if (--(sce->val4) >= 0) {
int hp = rnd()%600 + 200;
map_freeblock_lock();
status_fix_damage(NULL, bl, sd||hp<status->hp?hp:status->hp-1, 1, 0);
if( sc->data[type] ) {
if( status->hp == 1 ) {
map_freeblock_unlock();
break;
}
sc_timer_next(10000 + tick, status_change_timer, bl->id, data);
}
map_freeblock_unlock();
return 0;
}
break;
[/code]
That way it unlocks at the break; and so it doesn't break; without unlocking.
See: if( status->hp == 1 ) break;
I am almost certain this resolved the odd number of blocks and, as a result, potential crashes.
Not sure if there's anymore, but Ind and I were surely searching one day for them.
This post has been edited by
Cookie
on Jul 15, 2012 23:25
Hercules Elf Bot -
Jul 16, 2012 18:45
Originally posted by [b]Ind[/b]
should be fixed in [rev=16432] thank you again