[9624] varargs list (...) auto promote any float value to double and any less int type to int.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
jsee 2010-03-26 22:00:53 +03:00 committed by VladimirMangos
parent 634fd2a508
commit d46e6629e6
3 changed files with 6 additions and 5 deletions

View file

@ -369,16 +369,16 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, SplineTy
return; return;
case SPLINETYPE_FACINGSPOT: // facing spot, not used currently case SPLINETYPE_FACINGSPOT: // facing spot, not used currently
{ {
data << float(va_arg(vargs,float)); data << float(va_arg(vargs,double));
data << float(va_arg(vargs,float)); data << float(va_arg(vargs,double));
data << float(va_arg(vargs,float)); data << float(va_arg(vargs,double));
break; break;
} }
case SPLINETYPE_FACINGTARGET: case SPLINETYPE_FACINGTARGET:
data << uint64(va_arg(vargs,uint64)); data << uint64(va_arg(vargs,uint64));
break; break;
case SPLINETYPE_FACINGANGLE: // not used currently case SPLINETYPE_FACINGANGLE: // not used currently
data << float(va_arg(vargs,float)); // facing angle data << float(va_arg(vargs,double)); // facing angle
break; break;
} }

View file

@ -1376,6 +1376,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
void MonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime = 0); void MonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime = 0);
// recommend use MonsterMove/MonsterMoveWithSpeed for most case that correctly work with movegens // 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 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 SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end, SplineFlags flags);
void SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime = 0, Player* player = NULL); void SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime = 0, Player* player = NULL);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "9623" #define REVISION_NR "9624"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__