From c7e87337241236af311e30bfda1e0c83decac0a5 Mon Sep 17 00:00:00 2001 From: jsee Date: Fri, 26 Mar 2010 22:00:53 +0300 Subject: [PATCH] [9624] varargs list (...) auto promote any float value to double and any less int type to int. Signed-off-by: VladimirMangos --- src/game/Unit.cpp | 8 ++++---- src/game/Unit.h | 1 + src/shared/revision_nr.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index df818f919..8736bddd9 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -369,16 +369,16 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, SplineTy return; case SPLINETYPE_FACINGSPOT: // facing spot, not used currently { - data << float(va_arg(vargs,float)); - data << float(va_arg(vargs,float)); - data << float(va_arg(vargs,float)); + data << float(va_arg(vargs,double)); + data << float(va_arg(vargs,double)); + data << float(va_arg(vargs,double)); break; } case SPLINETYPE_FACINGTARGET: data << uint64(va_arg(vargs,uint64)); break; case SPLINETYPE_FACINGANGLE: // not used currently - data << float(va_arg(vargs,float)); // facing angle + data << float(va_arg(vargs,double)); // facing angle break; } diff --git a/src/game/Unit.h b/src/game/Unit.h index 5975a6091..b84329452 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1376,6 +1376,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject void MonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime = 0); // recommend use MonsterMove/MonsterMoveWithSpeed for most case that correctly work with movegens + // if used additional args in ... part then floats must explicitly casted to double void SendMonsterMove(float x, float y, float z, SplineType type, SplineFlags flags, uint32 Time, Player* player = NULL, ...); void SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end, SplineFlags flags); void SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime = 0, Player* player = NULL); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 65ca3d222..42be09961 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9623" + #define REVISION_NR "9624" #endif // __REVISION_NR_H__ -- 2.11.4.GIT