mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 13:30:06 +00:00
Compare commits
31 Commits
6956782027
...
9b2a65f8fd
Author | SHA1 | Date | |
---|---|---|---|
9b2a65f8fd | |||
6a69388822 | |||
2924a27eb4 | |||
ba20f5a401 | |||
|
eb88fa05cb | ||
|
0b73cef187 | ||
|
7af39b3d04 | ||
|
33206b1207 | ||
|
e325f7a40b | ||
|
82bee2051a | ||
|
4ece1bb89b | ||
|
31677e2638 | ||
|
d32827b692 | ||
|
13c009b448 | ||
|
a032497bed | ||
|
3b6b61d087 | ||
|
6d760f5bce | ||
|
2a622f901c | ||
|
03d28bf4e4 | ||
|
4b834579c5 | ||
|
07fe8ca367 | ||
|
2f3f8a3951 | ||
4f890a9c07 | |||
8517e0c7de | |||
5fb0cbbcf7 | |||
55e9f6531d | |||
|
7726357fbe | ||
|
564c275d51 | ||
|
3ce9ae5f77 | ||
|
7c5b9a8105 | ||
|
258ff35e20 |
@ -359,19 +359,23 @@ static void npcRotateCommand(std::string full, std::vector<std::string>& args, C
|
||||
int angle = (plr->angle + 180) % 360;
|
||||
NPCManager::updateNPCPosition(npc->id, npc->x, npc->y, npc->z, npc->instanceID, angle);
|
||||
|
||||
bool isGruntworkNpc = true;
|
||||
// if it's a gruntwork NPC, rotate in-place
|
||||
if (TableData::RunningMobs.find(npc->id) != TableData::RunningMobs.end()) {
|
||||
NPCManager::updateNPCPosition(npc->id, npc->x, npc->y, npc->z, npc->instanceID, angle);
|
||||
|
||||
// add a rotation entry to the gruntwork file, unless it's already a gruntwork NPC
|
||||
if (TableData::RunningMobs.find(npc->id) == TableData::RunningMobs.end()) {
|
||||
Chat::sendServerMessage(sock, "[NPCR] Successfully set angle to " + std::to_string(angle) + " for gruntwork NPC "
|
||||
+ std::to_string(npc->id));
|
||||
} else {
|
||||
TableData::RunningNPCRotations[npc->id] = angle;
|
||||
isGruntworkNpc = false;
|
||||
|
||||
Chat::sendServerMessage(sock, "[NPCR] Successfully set angle to " + std::to_string(angle) + " for NPC "
|
||||
+ std::to_string(npc->id));
|
||||
}
|
||||
|
||||
Chat::sendServerMessage(sock, "[NPCR] Successfully set angle to " + std::to_string(angle) +
|
||||
" for " + (isGruntworkNpc ? "gruntwork " : "") + "NPC " + std::to_string(npc->id));
|
||||
|
||||
// update rotation clientside by refreshing the player's chunks (same as the /refresh command)
|
||||
PlayerManager::updatePlayerPositionForWarp(sock, plr->x, plr->y, plr->z, plr->instanceID);
|
||||
// update rotation clientside
|
||||
INITSTRUCT(sP_FE2CL_NPC_ENTER, pkt);
|
||||
pkt.NPCAppearanceData = npc->getAppearanceData();
|
||||
sock->sendPacket(pkt, P_FE2CL_NPC_ENTER);
|
||||
}
|
||||
|
||||
static void refreshCommand(std::string full, std::vector<std::string>& args, CNSocket* sock) {
|
||||
|
Loading…
Reference in New Issue
Block a user