mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Enabled AI to use unarmed attack when switching weapons
Added build folders to gitignore.
This commit is contained in:
@@ -55,8 +55,10 @@ nb-configuration.xml
|
|||||||
# Build results
|
# Build results
|
||||||
[Dd]ebug/
|
[Dd]ebug/
|
||||||
[Dd]ebugPublic/
|
[Dd]ebugPublic/
|
||||||
|
[Dd]evXP
|
||||||
[Rr]elease/
|
[Rr]elease/
|
||||||
[Rr]eleases/
|
[Rr]eleases/
|
||||||
|
[Rr]eleaseXP/
|
||||||
x64/
|
x64/
|
||||||
x86/
|
x86/
|
||||||
build/
|
build/
|
||||||
|
|||||||
@@ -280,7 +280,14 @@ static long __fastcall ai_try_attack_switch_fix(fo::GameObject* target, long &hi
|
|||||||
}
|
}
|
||||||
return 1; // all good, execute vanilla behavior of ai_switch_weapons_ function
|
return 1; // all good, execute vanilla behavior of ai_switch_weapons_ function
|
||||||
}
|
}
|
||||||
|
|
||||||
// no other weapon in inventory
|
// no other weapon in inventory
|
||||||
|
if (weapon) {
|
||||||
|
if (fo::func::item_w_range(source, fo::AttackType::ATKTYPE_PUNCH) >= fo::func::obj_dist(source, target)) {
|
||||||
|
hitMode = fo::AttackType::ATKTYPE_PUNCH;
|
||||||
|
return 0; // change hit mode, continue attack cycle
|
||||||
|
}
|
||||||
|
}
|
||||||
return (weapon) ? -1 // exit, NPC has a weapon in hand slot, so we don't look for another weapon on the map
|
return (weapon) ? -1 // exit, NPC has a weapon in hand slot, so we don't look for another weapon on the map
|
||||||
: 1; // no weapon in inventory or hand slot, continue to search weapons on the map (call ai_switch_weapons_)
|
: 1; // no weapon in inventory or hand slot, continue to search weapons on the map (call ai_switch_weapons_)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user