mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 21:40:05 +00:00
Validate arguments to /level and /summonW; fix retreatStep() bug.
This commit is contained in:
parent
bae834fefa
commit
9f280c2c31
@ -61,6 +61,11 @@ void populationCommand(std::string full, std::vector<std::string>& args, CNSocke
|
|||||||
}
|
}
|
||||||
|
|
||||||
void levelCommand(std::string full, std::vector<std::string>& args, CNSocket* sock) {
|
void levelCommand(std::string full, std::vector<std::string>& args, CNSocket* sock) {
|
||||||
|
if (args.size() < 2) {
|
||||||
|
ChatManager::sendServerMessage(sock, "/level: no level specified");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Player *plr = PlayerManager::getPlayer(sock);
|
Player *plr = PlayerManager::getPlayer(sock);
|
||||||
if (plr == nullptr)
|
if (plr == nullptr)
|
||||||
return;
|
return;
|
||||||
@ -189,6 +194,10 @@ void mssCommand(std::string full, std::vector<std::string>& args, CNSocket* sock
|
|||||||
}
|
}
|
||||||
|
|
||||||
void summonWCommand(std::string full, std::vector<std::string>& args, CNSocket* sock) {
|
void summonWCommand(std::string full, std::vector<std::string>& args, CNSocket* sock) {
|
||||||
|
if (args.size() < 2) {
|
||||||
|
ChatManager::sendServerMessage(sock, "/level: no mob type specified");
|
||||||
|
return;
|
||||||
|
}
|
||||||
Player* plr = PlayerManager::getPlayer(sock);
|
Player* plr = PlayerManager::getPlayer(sock);
|
||||||
|
|
||||||
char *rest;
|
char *rest;
|
||||||
|
@ -403,7 +403,8 @@ void MobManager::retreatStep(Mob *mob, time_t currTime) {
|
|||||||
|
|
||||||
int distance = hypot(mob->appearanceData.iX - mob->spawnX, mob->appearanceData.iY - mob->spawnY);
|
int distance = hypot(mob->appearanceData.iX - mob->spawnX, mob->appearanceData.iY - mob->spawnY);
|
||||||
|
|
||||||
if (distance > mob->data["m_iIdleRange"]) {
|
//if (distance > mob->data["m_iIdleRange"]) {
|
||||||
|
if (distance > 10) {
|
||||||
INITSTRUCT(sP_FE2CL_NPC_MOVE, pkt);
|
INITSTRUCT(sP_FE2CL_NPC_MOVE, pkt);
|
||||||
|
|
||||||
auto targ = lerp(mob->appearanceData.iX, mob->appearanceData.iY, mob->spawnX, mob->spawnY, mob->data["m_iRunSpeed"]);
|
auto targ = lerp(mob->appearanceData.iX, mob->appearanceData.iY, mob->spawnX, mob->spawnY, mob->data["m_iRunSpeed"]);
|
||||||
|
Loading…
Reference in New Issue
Block a user