Fixed the previous bug (read more)
The bug was being caused by not assigning default values to the player objects' internals. I've added a quick fix to these structs, but I think it's best to expand them into proper classes now.
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
#include "SDL/SDL_net.h"
|
#include "SDL/SDL_net.h"
|
||||||
|
|
||||||
struct ClientEntry {
|
struct ClientEntry {
|
||||||
IPaddress address;
|
IPaddress address = {0,0};
|
||||||
static int uidCounter;
|
static int uidCounter;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+17
-17
@@ -36,25 +36,25 @@ struct PlayerEntry {
|
|||||||
std::string avatar;
|
std::string avatar;
|
||||||
|
|
||||||
//world position
|
//world position
|
||||||
int mapIndex;
|
int mapIndex = 0;
|
||||||
Vector2 position;
|
Vector2 position = {0.0,0.0};
|
||||||
Vector2 motion;
|
Vector2 motion = {0.0,0.0};
|
||||||
BBox bbox;
|
BBox bbox = {0,0,0,0};
|
||||||
|
|
||||||
//statistics
|
//statistics
|
||||||
int level;
|
int level = 0;
|
||||||
int exp;
|
int exp = 0;
|
||||||
int maxHP;
|
int maxHP = 0;
|
||||||
int health;
|
int health = 0;
|
||||||
int maxMP;
|
int maxMP = 0;
|
||||||
int mana;
|
int mana = 0;
|
||||||
int attack;
|
int attack = 0;
|
||||||
int defence;
|
int defence = 0;
|
||||||
int intelligence;
|
int intelligence = 0;
|
||||||
int resistance;
|
int resistance = 0;
|
||||||
float accuracy;
|
float accuracy = 0.0;
|
||||||
float evasion;
|
float evasion = 0.0;
|
||||||
float luck;
|
float luck = 0.0;
|
||||||
|
|
||||||
//uid
|
//uid
|
||||||
static int uidCounter;
|
static int uidCounter;
|
||||||
|
|||||||
Reference in New Issue
Block a user