Alright, i've looked this thing up and down and I can't figure out why It isn't sending the message, first of all, here's the code for explode:
void explode( OBJ_DATA *obj )
{
if ( obj->armed_by )
{
ROOM_INDEX_DATA *room;
CHAR_DATA *xch;
bool held = FALSE;
for ( xch = first_char; xch; xch = xch->next )
if ( !IS_NPC( xch ) && nifty_is_name( obj->armed_by, xch->name ) )
{
if ( obj->carried_by )
{
act( AT_WHITE, "$p EXPLODES in $n's hands!", obj->carried_by, obj, NULL, TO_ROOM );
act( AT_WHITE, "$p EXPLODES in your hands!", obj->carried_by, obj, NULL, TO_CHAR );
room = xch->in_room;
held = TRUE;
}
else if ( obj->in_room )
room = obj->in_room;
else
room = NULL;
if ( room )
{
if ( !held && room->first_person )
act( AT_WHITE, "$p EXPLODES!", room->first_person , obj, NULL, TO_ROOM );
room_explode( obj , xch, room );
}
}
}
make_scraps(obj);
}
when the armed item is sitting in the room, and the timer runs out, it seems that the message of "$p EXPLODES!" is not being sent, or at least not seen. Is there perhaps a small error with this?:
act( AT_WHITE, "$p EXPLODES!", room->first_person , obj, NULL, TO_ROOM );
everyone in the room does recieve damage, and the scraps are made. When someone is holding the item it sends the correct messages, but only they get hit with the "shockwave" from room_explode_1
void room_explode_1( OBJ_DATA *obj , CHAR_DATA *xch, ROOM_INDEX_DATA *room , int blast )
{
CHAR_DATA *rch;
CHAR_DATA *rnext;
OBJ_DATA *robj;
OBJ_DATA *robj_next;
int dam;
if ( IS_SET( room->room_flags, BFS_MARK ) )
return;
SET_BIT( room->room_flags , BFS_MARK );
for ( rch = room->first_person ; rch ; rch = rnext )
{
rnext = rch->next_in_room;
act( AT_WHITE, "The shockwave from a massive explosion rips through your body!", room->first_person , obj, NULL, TO_ROOM );
dam = number_range ( obj->value[0] , obj->value[1] );
damage( rch, rch , dam, TYPE_UNDEFINED );
if ( !char_died(rch) )
{
if ( IS_NPC( rch ) )
{
if ( IS_SET( rch->act , ACT_SENTINEL ) )
{
rch->was_sentinel = rch->in_room;
REMOVE_BIT( rch->act, ACT_SENTINEL );
}
start_hating( rch , xch );
start_hunting( rch , xch );
}
}
}
for ( robj = room->first_content; robj; robj = robj_next )
{
robj_next = robj->next_content;
if ( robj != obj && robj->item_type != ITEM_SPACECRAFT && robj->item_type != ITEM_SCRAPS
&& robj->item_type != ITEM_CORPSE_NPC && robj->item_type != ITEM_CORPSE_PC && robj->item_type != ITEM_DROID_CORPSE)
make_scraps( robj );
}
/* other rooms */
{
EXIT_DATA *pexit;
for ( pexit = room->first_exit; pexit; pexit = pexit->next )
{
if ( pexit->to_room
&& pexit->to_room != room )
{
if ( blast > 0 )
{
int roomblast;
roomblast = blast - 1;
room_explode_1( obj , xch, pexit->to_room , roomblast );
}
else
echo_to_room( AT_WHITE, pexit->to_room , "You hear a loud EXPLOSION not to far from here." );
}
}
}
}
Why is it doing this??
Thanks,
Kronos |