mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
Crash fixes oh my
This commit is contained in:
parent
467afc86af
commit
ca84040a39
@ -161,7 +161,7 @@ uint32 Database::CheckLogin(const char* name, const char* password, int16* oStat
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(results.RowCount() < 1)
|
if(results.RowCount() == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
|
|||||||
@ -64,6 +64,5 @@ bool MySQLRequestRow::operator!=(const MySQLRequestRow& rhs)
|
|||||||
|
|
||||||
char* MySQLRequestRow::operator[](int index)
|
char* MySQLRequestRow::operator[](int index)
|
||||||
{
|
{
|
||||||
|
|
||||||
return m_MySQLRow[index];
|
return m_MySQLRow[index];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1632,6 +1632,13 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) {
|
|||||||
|
|
||||||
int tempid = 0;
|
int tempid = 0;
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
|
|
||||||
|
if(result && mysql_field_count(getMySQL()) <= SPELL_LOAD_FIELD_COUNT) {
|
||||||
|
_log(SPELLS__LOAD_ERR, "Fatal error loading spells: Spell field count < SPELL_LOAD_FIELD_COUNT(%u)", SPELL_LOAD_FIELD_COUNT);
|
||||||
|
mysql_free_result(result);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
while (row = mysql_fetch_row(result)) {
|
while (row = mysql_fetch_row(result)) {
|
||||||
tempid = atoi(row[0]);
|
tempid = atoi(row[0]);
|
||||||
if(tempid >= max_spells) {
|
if(tempid >= max_spells) {
|
||||||
|
|||||||
@ -621,6 +621,8 @@ typedef enum {
|
|||||||
// number. note that the id field is counted as 0, this way the numbers
|
// number. note that the id field is counted as 0, this way the numbers
|
||||||
// here match the numbers given to sep in the loading function net.cpp
|
// here match the numbers given to sep in the loading function net.cpp
|
||||||
//
|
//
|
||||||
|
#define SPELL_LOAD_FIELD_COUNT 231
|
||||||
|
|
||||||
struct SPDat_Spell_Struct
|
struct SPDat_Spell_Struct
|
||||||
{
|
{
|
||||||
/* 000 */ int id; // not used
|
/* 000 */ int id; // not used
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user