Bug: Setting resets on rooms that have none yet will crash
Danger: High - Crash condition.
Found by: pstone
Fixed by: Remcon
---
reset.c, do_reset
in the "random" part find
if( ch->in_room->first_reset->prev )
ch->in_room->first_reset->prev = pReset;
change it to
if( ch->in_room->first_reset )
ch->in_room->first_reset->prev = pReset;
in the "trap" "obj" part find
if( pReset->first_reset->prev_reset )
pReset->first_reset->prev_reset = tReset;
change it to
if( pReset->first_reset )
pReset->first_reset->prev_reset = tReset;
find
if( ch->in_room->first_reset->prev )
ch->in_room->first_reset->prev = tReset;
change it to
if( ch->in_room->first_reset )
ch->in_room->first_reset->prev = tReset;
in the "hide" part find
if( pReset->first_reset->prev_reset )
pReset->first_reset->prev_reset = tReset;
change it to
if( pReset->first_reset )
pReset->first_reset->prev_reset = tReset;
find
if( ch->in_room->first_reset->prev )
ch->in_room->first_reset->prev = tReset;
change it to
if( ch->in_room->first_reset )
ch->in_room->first_reset->prev = tReset;
Remcon said:
This fixes crashing issues found caused by first_reset being NULL when adding in new resets.
I'll just let Remcon's fix speak for itself.