MCPcopy Create free account
hub / github.com/crossuo/crossuo / UpdateItemInContainer

Method UpdateItemInContainer

src/GameObjects/GameWorld.cpp:1111–1151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1109}
1110
1111void CGameWorld::UpdateItemInContainer(CGameObject *obj, CGameObject *container, int x, int y)
1112{
1113 obj->SetX(x);
1114 obj->SetY(y);
1115 PutContainer(obj, container);
1116 const uint32_t containerSerial = container->Serial;
1117
1118 CGump *gump = g_GumpManager.UpdateContent(containerSerial, 0, GT_BULLETIN_BOARD);
1119 // Message board item
1120 if (gump != nullptr)
1121 {
1122 CPacketBulletinBoardRequestMessageSummary(containerSerial, obj->Serial).Send();
1123 }
1124 else
1125 {
1126 gump = g_GumpManager.UpdateContent(containerSerial, 0, GT_SPELLBOOK);
1127 if (gump == nullptr)
1128 {
1129 gump = g_GumpManager.UpdateContent(containerSerial, 0, GT_CONTAINER);
1130 if (gump != nullptr && gump->GumpType == GT_CONTAINER)
1131 {
1132 ((CGumpContainer *)gump)->UpdateItemCoordinates(obj);
1133 g_GumpManager.UpdateContent(0, 0, GT_RESOURCETRACKER);
1134 }
1135 }
1136 if (gump != nullptr && !container->NPC)
1137 {
1138 ((CGameItem *)container)->Opened = true;
1139 }
1140 }
1141
1142 CGameObject *top = container->GetTopObject();
1143 if (top != nullptr)
1144 {
1145 top = top->FindSecureTradeBox();
1146 if (top != nullptr)
1147 {
1148 g_GumpManager.UpdateContent(0, top->Serial, GT_TRADE);
1149 }
1150 }
1151}
1152
1153void CGameWorld::UpdateContainedItem(
1154 uint32_t serial,

Callers

nothing calls this directly

Calls 8

SetXMethod · 0.80
SetYMethod · 0.80
UpdateItemCoordinatesMethod · 0.80
GetTopObjectMethod · 0.80
UpdateContentMethod · 0.45
SendMethod · 0.45
FindSecureTradeBoxMethod · 0.45

Tested by

no test coverage detected