mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Fixed a bug in knockback modifier functions that could crash the game (#237)
Updated version number.
This commit is contained in:
+5
-5
@@ -73,8 +73,8 @@ static double ApplyModifiers(std::vector<KnockbackModifier>* mods, TGameObj* obj
|
||||
|
||||
static DWORD __fastcall CalcKnockbackMod(int knockValue, int damage, TGameObj* weapon, TGameObj* attacker, TGameObj* target) {
|
||||
double result = (double)damage / (double)knockValue;
|
||||
result = ApplyModifiers(&mWeapons, weapon, result);
|
||||
result = ApplyModifiers(&mAttackers, attacker, result);
|
||||
if (weapon) result = ApplyModifiers(&mWeapons, weapon, result);
|
||||
if (attacker) result = ApplyModifiers(&mAttackers, attacker, result);
|
||||
result = ApplyModifiers(&mTargets, target, result);
|
||||
return (DWORD)floor(result);
|
||||
}
|
||||
@@ -97,9 +97,9 @@ static void __declspec(naked) compute_dmg_damage_hack() {
|
||||
__asm {
|
||||
push ecx
|
||||
push esi; // Target
|
||||
mov eax, -1;
|
||||
push eax; // Attacker
|
||||
push eax; // Weapon
|
||||
xor eax, eax;
|
||||
push eax; // Attacker (no attacker)
|
||||
push eax; // Weapon (no weapon)
|
||||
mov edx, ebx; // Damage
|
||||
mov ecx, 10; // Knockback value
|
||||
call CalcKnockbackMod;
|
||||
|
||||
+3
-3
@@ -25,12 +25,12 @@
|
||||
#define VERSION_MAJOR 3
|
||||
#define VERSION_MINOR 8
|
||||
#define VERSION_BUILD 18
|
||||
#define VERSION_REV 0
|
||||
#define VERSION_REV 1
|
||||
|
||||
#ifdef WIN2K
|
||||
#define VERSION_STRING "3.8.18 win2k"
|
||||
#define VERSION_STRING "3.8.18.1 win2k"
|
||||
#else
|
||||
#define VERSION_STRING "3.8.18"
|
||||
#define VERSION_STRING "3.8.18.1"
|
||||
#endif
|
||||
|
||||
//#define CHECK_VAL (4)
|
||||
|
||||
Reference in New Issue
Block a user