double to float explicit conversion

This commit is contained in:
Arthur Dene Ice
2014-05-05 19:03:27 -07:00
parent 554daf7b88
commit 5eb260b0cb
10 changed files with 86 additions and 86 deletions
+13 -13
View File
@@ -1169,11 +1169,11 @@ bool Database::GetSafePoints(const char* short_name, uint32 version, float* safe
if (mysql_num_rows(result) > 0) {
row = mysql_fetch_row(result);
if (safe_x != 0)
*safe_x = atof(row[0]);
*safe_x = (float)atof(row[0]);
if (safe_y != 0)
*safe_y = atof(row[1]);
*safe_y = (float)atof(row[1]);
if (safe_z != 0)
*safe_z = atof(row[2]);
*safe_z = (float)atof(row[2]);
if (minstatus != 0)
*minstatus = atoi(row[3]);
if (minlevel != 0)
@@ -1221,11 +1221,11 @@ bool Database::GetZoneLongName(const char* short_name, char** long_name, char* f
strcpy(file_name, row[1]);
}
if (safe_x != 0)
*safe_x = atof(row[2]);
*safe_x = (float)atof(row[2]);
if (safe_y != 0)
*safe_y = atof(row[3]);
*safe_y = (float)atof(row[3]);
if (safe_z != 0)
*safe_z = atof(row[4]);
*safe_z = (float)atof(row[4]);
if (graveyard_id != 0)
*graveyard_id = atoi(row[5]);
if (maxclients)
@@ -1283,13 +1283,13 @@ bool Database::GetZoneGraveyard(const uint32 graveyard_id, uint32* graveyard_zon
if(graveyard_zoneid != 0)
*graveyard_zoneid = atoi(row[0]);
if(graveyard_x != 0)
*graveyard_x = atof(row[1]);
*graveyard_x = (float)atof(row[1]);
if(graveyard_y != 0)
*graveyard_y = atof(row[2]);
*graveyard_y = (float)atof(row[2]);
if(graveyard_z != 0)
*graveyard_z = atof(row[3]);
*graveyard_z = (float)atof(row[3]);
if(graveyard_heading != 0)
*graveyard_heading = atof(row[4]);
*graveyard_heading = (float)atof(row[4]);
mysql_free_result(result);
return true;
}
@@ -1852,11 +1852,11 @@ uint32 Database::GetCharacterInfo(const char* iName, uint32* oAccID, uint32* oZo
if(oInstanceID)
*oInstanceID = atoi(row[3]);
if (oX)
*oX = atof(row[4]);
*oX = (float)atof(row[4]);
if (oY)
*oY = atof(row[5]);
*oY = (float)atof(row[5]);
if (oZ)
*oZ = atof(row[6]);
*oZ = (float)atof(row[6]);
mysql_free_result(result);
return charid;
}
+1 -1
View File
@@ -1899,7 +1899,7 @@ ENCODE(OP_ZoneSpawns)
VARSTRUCT_ENCODE_STRING(Buffer, emu->name);
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->spawnId);
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->level);
VARSTRUCT_ENCODE_TYPE(float, Buffer, SpawnSize - 0.7); // Eye Height?
VARSTRUCT_ENCODE_TYPE(float, Buffer, SpawnSize - 0.7f); // Eye Height?
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->NPC);
structs::Spawn_Struct_Bitfields *Bitfields = (structs::Spawn_Struct_Bitfields*)Buffer;
+1 -1
View File
@@ -1047,7 +1047,7 @@ ENCODE(OP_ZoneSpawns) {
}
else
{
VARSTRUCT_ENCODE_TYPE(float, Buffer, SpawnSize - 0.7); // Eye Height?
VARSTRUCT_ENCODE_TYPE(float, Buffer, SpawnSize - 0.7f); // Eye Height?
}
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->NPC);
+1 -1
View File
@@ -1059,7 +1059,7 @@ ENCODE(OP_ZoneSpawns) {
}
else
{
VARSTRUCT_ENCODE_TYPE(float, Buffer, SpawnSize - 0.7); // Eye Height?
VARSTRUCT_ENCODE_TYPE(float, Buffer, SpawnSize - 0.7f); // Eye Height?
}
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->NPC);
+1 -1
View File
@@ -171,7 +171,7 @@ bool RuleManager::SetRule(const char *rule_name, const char *rule_value, Databas
_log(RULES__CHANGE, "Set rule %s to value %d", rule_name, m_RuleIntValues[index]);
break;
case RealRule:
m_RuleRealValues[index] = atof(rule_value);
m_RuleRealValues[index] = (float)atof(rule_value);
_log(RULES__CHANGE, "Set rule %s to value %.13f", rule_name, m_RuleRealValues[index]);
break;
case BoolRule:
+3 -3
View File
@@ -1220,9 +1220,9 @@ bool SharedDatabase::GetPlayerProfile(uint32 account_id, char* name, PlayerProfi
if (current_zone)
strcpy(current_zone, row[1]);
pp->zone_id = GetZoneID(row[1]);
pp->x = atof(row[2]);
pp->y = atof(row[3]);
pp->z = atof(row[4]);
pp->x = (float)atof(row[2]);
pp->y = (float)atof(row[3]);
pp->z = (float)atof(row[4]);
pp->zoneInstance = atoi(row[6]);
if (pp->x == -1 && pp->y == -1 && pp->z == -1)
GetSafePoints(pp->zone_id, GetInstanceVersion(pp->zoneInstance), &pp->x, &pp->y, &pp->z);