Author Topic: Combat Bug  (Read 1063 times)

Offline Nilrin

  • Friend
  • **
  • Posts: 85
    • View Profile
Combat Bug
« on: June 25, 2013, 12:04:49 AM »
This was a bug discovered in Dead Souls 3.7a7.

In /lib/combat.c line 581 (Probably different for stock distribution).

Code: [Select]
    if( position == POSITION_LYING || position == POSITION_SITTING &&
            RACES_D->GetLimblessCombatRace(this_object()->GetRace()) != 1){
        if(this_object()->CanFly()){
            this_object()->eventFly();
        }
        else if(objectp(target) && (((this_object()->GetSize(1)) -
                        target->GetSize(1)) < 2) ){
            this_object()->eventPrint("You can't fight "+
                    target_name+" unless you are up!");
            return 0;
        }
    }

To:

Code: [Select]
    if( (position == POSITION_LYING || position == POSITION_SITTING) &&
            RACES_D->GetLimblessCombatRace(this_object()->GetRace()) != 1){
        if(this_object()->CanFly()){
            this_object()->eventFly();
        }
        else if(objectp(target) && (((this_object()->GetSize(1)) -
                        target->GetSize(1)) < 2) ){
            this_object()->eventPrint("You can't fight "+
                    target_name+" unless you are up!");
            return 0;
        }
    }

Just needs a parentheses in the 'IF' statement.