mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2026-03-04 23:10:04 +00:00
Assorted cleanups and fixes.
* Clean up spacing/indentation * Proper enum formatting * Fix nano dismissal (for real this time) * Do not copy Player struct when a pointer is right there * Stop looking after the trade partner has been found * Make sure we're shifting unsigned values (and 64-bit when they need to be) * Look for JSONs in tdata/ * Add a dbsaveinterval to the example config.ini, in the login category
This commit is contained in:
@@ -152,6 +152,7 @@ void NanoManager::addNano(CNSocket* sock, int16_t nanoId, int16_t slot) {
|
||||
// Update player
|
||||
plr->Nanos[nanoId] = resp.Nano;
|
||||
plr->level = level;
|
||||
plr->HP = 1000 * plr->level;
|
||||
|
||||
sock->sendPacket((void*)&resp, P_FE2CL_REP_PC_NANO_CREATE_SUCC, sizeof(sP_FE2CL_REP_PC_NANO_CREATE_SUCC));
|
||||
|
||||
@@ -183,16 +184,17 @@ void NanoManager::summonNano(CNSocket *sock, int slot) {
|
||||
|
||||
int nanoId = slot == -1 ? -1 : plr->equippedNanos[slot];
|
||||
|
||||
if (nanoId > 36 || nanoId < 0)
|
||||
if (nanoId > 36 || nanoId < -1)
|
||||
return; // sanity check
|
||||
|
||||
sNano nano = plr->Nanos[nanoId];
|
||||
|
||||
// Send to other players
|
||||
INITSTRUCT(sP_FE2CL_NANO_ACTIVE, pkt1);
|
||||
|
||||
pkt1.iPC_ID = plr->iID;
|
||||
pkt1.Nano = nano;
|
||||
if (nanoId == -1)
|
||||
memset(&pkt1.Nano, 0, sizeof(pkt1.Nano));
|
||||
else
|
||||
pkt1.Nano = plr->Nanos[nanoId];
|
||||
|
||||
for (CNSocket* s : PlayerManager::players[sock].viewable)
|
||||
s->sendPacket((void*)&pkt1, P_FE2CL_NANO_ACTIVE, sizeof(sP_FE2CL_NANO_ACTIVE));
|
||||
|
||||
Reference in New Issue
Block a user