Decompile fn_17201 (UIWindowMgr::HasTitleAtActorCell)
Batch #6220 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_17201 UIWindowMgr::HasTitleAtActorCell: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, alisonrag, System4z Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
d38f57329a
commit
d2fab322d2
3 changed files with 61 additions and 0 deletions
|
|
@ -4,6 +4,14 @@
|
|||
#include "UI/Party/UIMiniPartyWnd.h"
|
||||
#include <algorithm>
|
||||
#include "Client/Session.h"
|
||||
#include "Client/Mode/CGameMode.h"
|
||||
#include "Client/Mode/ModeMgr.h"
|
||||
#include "Contents/Actors/RenderObject.h"
|
||||
#include "Contents/World/World.h"
|
||||
#include "Resource/World/TerrainResource.h"
|
||||
#include "UI/Chat/UIChatRoomTitle.h"
|
||||
#include "UI/Shop/UIMerchantShopTitle.h"
|
||||
#include <typeinfo>
|
||||
|
||||
// STATIC: 0x014576A0
|
||||
// GLOBAL: gl_24367
|
||||
|
|
@ -146,6 +154,56 @@ bool UIWindowMgr::HasPendingDialog() {
|
|||
this->unknown_01F4;
|
||||
}
|
||||
|
||||
// OFFSET: 0x00A97200
|
||||
// FUNCTION: fn_17201
|
||||
bool UIWindowMgr::HasTitleAtActorCell(std::uint32_t aid) {
|
||||
CRenderObject* actor = static_cast<CGameMode*>(g_modeMgr.GetGameMode())->scene->GetGameActorByAidIncludeMe(aid);
|
||||
if (actor == nullptr) {
|
||||
return true;
|
||||
}
|
||||
|
||||
int titleColumn = 0;
|
||||
int titleRow = 0;
|
||||
int actorColumn = 0;
|
||||
int actorRow = 0;
|
||||
CWorld* world = static_cast<CGameMode*>(g_modeMgr.GetGameMode())->scene;
|
||||
world->terrain->Grid().SpatialCell(actor->render.position.x, actor->render.position.z, actorColumn, actorRow);
|
||||
for (std::list<UIWindow*>::iterator it = this->rendered.begin(); it != this->rendered.end(); ++it) {
|
||||
UIWindow* window = *it;
|
||||
CRenderObject* owner;
|
||||
if (typeid(*window) == typeid(UIMerchantShopTitle)) {
|
||||
owner = g_session.FindGameActor(static_cast<UIMerchantShopTitle*>(window)->ownerAid);
|
||||
if (owner == nullptr) {
|
||||
return true;
|
||||
}
|
||||
} else if (typeid(*window) == typeid(UIChatRoomTitle)) {
|
||||
const int roomId = static_cast<UIChatRoomTitle*>(window)->roomId;
|
||||
if (roomId == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const std::uint32_t ownerAid = static_cast<CGameMode*>(g_modeMgr.GetGameMode())->FindUnknown01AC(roomId);
|
||||
if (ownerAid == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
owner = g_session.FindGameActor(ownerAid);
|
||||
if (owner == nullptr) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
world->terrain->Grid().SpatialCell(owner->render.position.x, owner->render.position.z, titleColumn, titleRow);
|
||||
if (titleColumn == actorColumn && titleRow == actorRow) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// OFFSET: 0x00A97490
|
||||
// FUNCTION: fn_17204
|
||||
void UIWindowMgr::CancelActiveDialog() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue