Minor code edits to the previous commit

This commit is contained in:
NovaRain
2021-09-26 07:28:19 +08:00
parent 770fd7e63c
commit 2fe3ccd01d
3 changed files with 8 additions and 13 deletions
+2 -2
View File
@@ -417,7 +417,7 @@ static void __declspec(naked) DisplayBonusHtHDmg2_hack() {
long DamageMod::GetHtHMinDamageBonus(fo::GameObject* source) {
return (bonusHtHDamageFix)
? game::Stats::perk_level(source, fo::Perk::PERK_bonus_hth_damage) << 1 // Rank_of_Bonus_HtH_Damage_perk *= 2
? game::Stats::perk_level(source, fo::Perk::PERK_bonus_hth_damage) << 1 // Multiply by 2
: 0;
}
@@ -464,7 +464,7 @@ void DamageMod::init() {
dlogr(" Done", DL_INIT);
}
// Display actual damage values for unarmed attacks (display_stats_ hacks)
// Display the actual damage values of unarmed attacks (display_stats_ hacks)
MakeJump(0x472546, DisplayBonusHtHDmg2_hack);
SafeWrite32(0x472558, 0x509EDC); // fmt: '%s %d-%d'
SafeWrite8(0x472552, 0x98 + 4);
+3 -3
View File
@@ -51,12 +51,12 @@ void InventoryKeyPressedHook(DWORD dxKey, bool pressed) {
if (maxAmmo != curAmmo) {
long &currentMode = fo::util::GetActiveItemMode();
long previusMode = currentMode;
currentMode = 5; // reload mode
currentMode = fo::HandSlotMode::Reload;
fo::func::intface_use_item();
if (previusMode != 5) {
if (previusMode != fo::HandSlotMode::Reload) {
// return to previous active item mode (if it wasn't "reload")
currentMode = previusMode - 1;
if (currentMode < 0) currentMode = 4;
if (currentMode < 0) currentMode = fo::HandSlotMode::Secondary_Aimed;
fo::func::intface_toggle_item_state();
}
}
+3 -8
View File
@@ -31,7 +31,7 @@ namespace sfall
static struct {
fo::AttackType primaryHit;
fo::AttackType secondaryHit;
long mode;
fo::HandSlotMode mode;
} slotHitData[2];
class Hits {
@@ -374,13 +374,8 @@ fo::AttackType Unarmed::GetStoredHitMode(fo::HandSlot slot) {
if (hit < fo::AttackType::ATKTYPE_STRONGPUNCH && hit != fo::AttackType::ATKTYPE_PUNCH && hit != fo::AttackType::ATKTYPE_KICK) {
hit = (slot == fo::HandSlot::Left) ? GetPunchingHit() : GetKickingHit(); // get Primary
if (slot == fo::HandSlot::Left) {
slotHitData[fo::HandSlot::Left].primaryHit = hit;
slotHitData[fo::HandSlot::Left].mode = fo::HandSlotMode::Primary;
} else {
slotHitData[fo::HandSlot::Right].primaryHit = hit;
slotHitData[fo::HandSlot::Right].mode = fo::HandSlotMode::Primary;
}
slotHitData[slot].primaryHit = hit;
slotHitData[slot].mode = fo::HandSlotMode::Primary;
}
return hit;
}