Changeset 6 for trunk/src/game/Unit.cpp
- Timestamp:
- 11/19/08 13:22:12 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Unit.cpp
r2 r6 2991 2991 if(player->CanParry() ) 2992 2992 { 2993 Item *tmpitem = ((Player*)this)->GetWeaponForAttack(BASE_ATTACK,true);2993 Item *tmpitem = player->GetWeaponForAttack(BASE_ATTACK,true); 2994 2994 if(!tmpitem) 2995 tmpitem = ((Player*)this)->GetWeaponForAttack(OFF_ATTACK,true);2995 tmpitem = player->GetWeaponForAttack(OFF_ATTACK,true); 2996 2996 2997 2997 if(tmpitem) … … 3018 3018 if(GetTypeId() == TYPEID_PLAYER) 3019 3019 { 3020 Item *tmpitem = ((Player const*)this)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND); 3021 if(tmpitem && !tmpitem->IsBroken() && tmpitem->GetProto()->Block) 3022 return GetFloatValue(PLAYER_BLOCK_PERCENTAGE); 3023 else 3024 return 0.0f; 3020 Player const* player = (Player const*)this; 3021 if(player->CanBlock() ) 3022 { 3023 Item *tmpitem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND); 3024 if(tmpitem && !tmpitem->IsBroken() && tmpitem->GetProto()->Block) 3025 return GetFloatValue(PLAYER_BLOCK_PERCENTAGE); 3026 } 3027 // is player but has no block ability or no not broken shield equiped 3028 return 0.0f; 3025 3029 } 3026 3030 else … … 3416 3420 return c->canSwim(); 3417 3421 else 3418 return c->canWalk() ;3422 return c->canWalk() || c->canFly(); 3419 3423 } 3420 3424