mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-12-22 19:30:05 +00:00
Merge pull request #50 from dongresource/bugfix
Fix crash when receiving invalid packets with very low ids.
This commit is contained in:
commit
64d4b1d26a
@ -204,13 +204,13 @@ std::string Defines::p2str(int type, int val) {
|
||||
switch (type) {
|
||||
case CL2LS:
|
||||
val = val - CL2LS - 1;
|
||||
if (val > N_CL2LS)
|
||||
if (val > N_CL2LS || val < 0)
|
||||
break;
|
||||
|
||||
return cl2ls_map[val].name;
|
||||
case CL2FE:
|
||||
val = val - CL2FE - 1;
|
||||
if (val > N_CL2FE)
|
||||
if (val > N_CL2FE || val < 0)
|
||||
break;
|
||||
|
||||
return cl2fe_map[val].name;
|
||||
|
@ -106,9 +106,9 @@ void NPCManager::updatePlayerNPCS(CNSocket* sock, PlayerView& view) {
|
||||
|
||||
// remove from view
|
||||
view.viewableNPCs.erase(i++);
|
||||
} else {
|
||||
i++;
|
||||
}
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
INITSTRUCT(sP_FE2CL_NPC_ENTER, enterData);
|
||||
|
Loading…
Reference in New Issue
Block a user