chore(Core/Misc): update floor and ceil to std (#19837)

This commit is contained in:
Kitzunu
2024-09-03 13:01:00 +02:00
committed by GitHub
parent de2bcbdabf
commit 9af86553c5
10 changed files with 28 additions and 20 deletions

View File

@@ -234,7 +234,7 @@ public:
me->SetInFront(me->GetVictim());
}
/*if (float dist = me->IsWithinDist3d(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 5.0f) dist = 5.0f;
SDisruptAOEVisual_Timer = 1000 + floor(dist / 30 * 1000.0f);*/
SDisruptAOEVisual_Timer = 1000 + std::floor(dist / 30 * 1000.0f);*/
events.ScheduleEvent(EVENT_STATIC_DISRUPTION, urand(10000, 18000));
break;
}

View File

@@ -34,6 +34,7 @@
#include "SpellScriptLoader.h"
#include "Vehicle.h"
#include "World.h"
#include <cmath>
enum eWGqueuenpctext
{
@@ -1089,7 +1090,7 @@ class spell_wg_reduce_damage_by_distance : public SpellScript
float maxDistance = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster()); // Xinef: always stored in EFFECT_0
float distance = std::min<float>(GetHitUnit()->GetDistance(*GetExplTargetDest()), maxDistance);
int32 damage = std::max<int32>(0, int32(GetHitDamage() - floor(GetHitDamage() * (distance / maxDistance))));
int32 damage = std::max<int32>(0, int32(GetHitDamage() - std::floor(GetHitDamage() * (distance / maxDistance))));
SetHitDamage(damage);
}

View File

@@ -35,6 +35,7 @@
#include "Unit.h"
#include "Vehicle.h"
#include <array>
#include <cmath>
/*
* Scripts for spells with SPELLFAMILY_GENERIC which cannot be included in AI script file
* of creature using it or can't be bound to any player class.
@@ -4255,7 +4256,7 @@ class spell_gen_gift_of_naaru : public AuraScript
break;
}
int32 healTick = floor(heal / aurEff->GetTotalTicks());
int32 healTick = std::floor(heal / aurEff->GetTotalTicks());
amount += int32(std::max(healTick, 0));
}