mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-02 06:02:25 +00:00
isnan fix for vs2012
This commit is contained in:
parent
413538f1b5
commit
7b85b09f24
@ -50,6 +50,16 @@
|
|||||||
#include "extprofile.h"
|
#include "extprofile.h"
|
||||||
extern Client client;
|
extern Client client;
|
||||||
|
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
#if _MSC_VER > 1700 // greater than 2012 (2013+)
|
||||||
|
# define _ISNAN_(a) std::isnan(a)
|
||||||
|
#else
|
||||||
|
# include <float.h>
|
||||||
|
# define _ISNAN_(a) _isnan(a)
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
# define _ISNAN_(a) std::isnan(a)
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Establish a connection to a mysql database with the supplied parameters
|
Establish a connection to a mysql database with the supplied parameters
|
||||||
@ -1756,7 +1766,7 @@ bool Database::CheckDatabaseConversions() {
|
|||||||
if (rquery != ""){ results = QueryDatabase(rquery); ThrowDBError(results.ErrorMessage(), "AA Convert", rquery); }
|
if (rquery != ""){ results = QueryDatabase(rquery); ThrowDBError(results.ErrorMessage(), "AA Convert", rquery); }
|
||||||
|
|
||||||
/* Run Bind Home Convert */
|
/* Run Bind Home Convert */
|
||||||
if(pp->binds[4].zoneId < 999 && !std::isnan(pp->binds[4].x) && !std::isnan(pp->binds[4].y) && !std::isnan(pp->binds[4].z) && !std::isnan(pp->binds[4].heading)) {
|
if(pp->binds[4].zoneId < 999 && !_ISNAN_(pp->binds[4].x) && !_ISNAN_(pp->binds[4].y) && !_ISNAN_(pp->binds[4].z) && !_ISNAN_(pp->binds[4].heading)) {
|
||||||
rquery = StringFormat("REPLACE INTO `character_bind` (id, zone_id, instance_id, x, y, z, heading, is_home)"
|
rquery = StringFormat("REPLACE INTO `character_bind` (id, zone_id, instance_id, x, y, z, heading, is_home)"
|
||||||
" VALUES (%u, %u, %u, %f, %f, %f, %f, 1)",
|
" VALUES (%u, %u, %u, %f, %f, %f, %f, 1)",
|
||||||
character_id, pp->binds[4].zoneId, 0, pp->binds[4].x, pp->binds[4].y, pp->binds[4].z, pp->binds[4].heading);
|
character_id, pp->binds[4].zoneId, 0, pp->binds[4].x, pp->binds[4].y, pp->binds[4].z, pp->binds[4].heading);
|
||||||
@ -1764,7 +1774,7 @@ bool Database::CheckDatabaseConversions() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Run Bind Convert */
|
/* Run Bind Convert */
|
||||||
if(pp->binds[0].zoneId < 999 && !std::isnan(pp->binds[0].x) && !std::isnan(pp->binds[0].y) && !std::isnan(pp->binds[0].z) && !std::isnan(pp->binds[0].heading)) {
|
if(pp->binds[0].zoneId < 999 && !_ISNAN_(pp->binds[0].x) && !_ISNAN_(pp->binds[0].y) && !_ISNAN_(pp->binds[0].z) && !_ISNAN_(pp->binds[0].heading)) {
|
||||||
rquery = StringFormat("REPLACE INTO `character_bind` (id, zone_id, instance_id, x, y, z, heading, is_home)"
|
rquery = StringFormat("REPLACE INTO `character_bind` (id, zone_id, instance_id, x, y, z, heading, is_home)"
|
||||||
" VALUES (%u, %u, %u, %f, %f, %f, %f, 0)",
|
" VALUES (%u, %u, %u, %f, %f, %f, %f, 0)",
|
||||||
character_id, pp->binds[0].zoneId, 0, pp->binds[0].x, pp->binds[0].y, pp->binds[0].z, pp->binds[0].heading);
|
character_id, pp->binds[0].zoneId, 0, pp->binds[0].x, pp->binds[0].y, pp->binds[0].z, pp->binds[0].heading);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user