Help!, I added (or thought I did) multiple attacks to my fight.c, and now I get
a core dump, in the middle of a battle. Is there something wrong with my
perform_violence? Or is it somewhere else?
Any comments would be appreciated.
/* control the fights going on. Called every 2 seconds from comm.c. */
void perform_violence(int i)
{
struct char_data *ch;
extern struct index_data *mob_index;
for (ch = combat_list; ch; ch = next_combat_list) {
next_combat_list = ch->next_fighting;
if (FIGHTING(ch) == NULL || ch->in_room != FIGHTING(ch)->in_room) {
stop_fighting(ch);
continue;
}
if (IS_NPC(ch)) {
if (GET_MOB_WAIT(ch) > 0) {
GET_MOB_WAIT(ch) -= PULSE_VIOLENCE;
continue;
}
GET_MOB_WAIT(ch) = 0;
if (GET_POS(ch) < POS_FIGHTING) {
GET_POS(ch) = POS_FIGHTING;
act("$n scrambles to $s feet!", TRUE, ch, 0, 0, TO_ROOM);
}
}
if (GET_POS(ch) < POS_FIGHTING) {
send_to_char("You can't fight while sitting!!\r\n", ch);
continue;
}
if (AWAKE(ch) && (ch->in_room == FIGHTING(ch)->in_room)) {
hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
if ((GET_SKILL(ch, SKILL_SECOND) > 0)) {
if (GET_SKILL(ch, SKILL_SECOND) > number(1,200)-5*GET_LEVEL(ch) )
if (FIGHTING(ch));
hit(ch,FIGHTING(ch),TYPE_UNDEFINED);
}
if (!IS_NPC(ch) && (GET_SKILL(ch, SKILL_THIRD) > 0)) {
for (i = 0; i < 4; i++){
if (GET_SKILL(ch, SKILL_THIRD) > number(1,500)-10*GET_LEVEL(ch))
if(FIGHTING(ch));
hit(ch,FIGHTING(ch),TYPE_UNDEFINED);
}
}
} else { /* Not in same room */
stop_fighting(ch);
}
if (MOB_FLAGGED(ch, MOB_SPEC) && mob_index[GET_MOB_RNUM(ch)].func != NULL)
(mob_index[GET_MOB_RNUM(ch)].func) (ch, ch, 0, "");
}
}
--
--
Bob Haeffner
Software Engineer
Moonlight Media, Inc.
http: www.moonlight.net
phone: (601) 969-1611
fax: (601) 969-1677
pager: (800) 391-2410
email: bob@moonlight.net
+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://cspo.queensu.ca/~fletcher/Circle/list_faq.html |
+-----------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/18/00 PST