ManaPlus
Functions
TmwAthena::ItemRecv Namespace Reference

Functions

void processItemDropped (Net::MessageIn &msg)
 
void processItemVisible (Net::MessageIn &msg)
 

Function Documentation

◆ processItemDropped()

void TmwAthena::ItemRecv::processItemDropped ( Net::MessageIn msg)

Definition at line 35 of file itemrecv.cpp.

36 {
37  const BeingId id = msg.readBeingId("item object id");
38  const int itemId = msg.readInt16("item id");
39  const Identified identify = fromInt(msg.readUInt8("identify"), Identified);
40  const int x = msg.readInt16("x");
41  const int y = msg.readInt16("y");
42  const int subX = CAST_S32(msg.readInt8("sub x"));
43  const int subY = CAST_S32(msg.readInt8("sub y"));
44  const int amount = msg.readInt16("amount");
45 
46  if (actorManager != nullptr)
47  {
49  itemId,
50  x, y,
52  amount,
53  0,
55  identify,
57  subX, subY,
58  nullptr);
59  }
60 }
ActorManager * actorManager
int BeingId
Definition: beingid.h:30
#define CAST_S32
Definition: cast.h:30
FloorItem * createItem(const BeingId id, const int itemId, const int x, const int y, const ItemTypeT itemType, const int amount, const int refine, const ItemColor color, const Identified identified, const Damaged damaged, const int subX, const int subY, const int *const cards)
const bool Damaged_false
Definition: damaged.h:30
bool Identified
Definition: identified.h:30
#define fromInt(val, name)
Definition: intdefines.h:46
const ItemColor ItemColor_one
Definition: itemcolor.h:30
bool msg(InputEvent &event)
Definition: chat.cpp:39
@ Unknown
Definition: itemtype.h:30

References actorManager, CAST_S32, ActorManager::createItem(), Damaged_false, fromInt, ItemColor_one, Actions::msg(), ItemType::Unknown, x, and y.

◆ processItemVisible()

void TmwAthena::ItemRecv::processItemVisible ( Net::MessageIn msg)

Definition at line 62 of file itemrecv.cpp.

63 {
64  const BeingId id = msg.readBeingId("item object id");
65  const int itemId = msg.readInt16("item id");
66  const Identified identified = fromInt(
67  msg.readUInt8("identify"), Identified);
68  const int x = msg.readInt16("x");
69  const int y = msg.readInt16("y");
70  const int amount = msg.readInt16("amount");
71  const int subX = CAST_S32(msg.readInt8("sub x"));
72  const int subY = CAST_S32(msg.readInt8("sub y"));
73 
74  if (actorManager != nullptr)
75  {
77  itemId,
78  x, y,
80  amount,
81  0,
83  identified,
85  subX, subY,
86  nullptr);
87  }
88 }

References actorManager, CAST_S32, ActorManager::createItem(), Damaged_false, fromInt, ItemColor_one, Actions::msg(), ItemType::Unknown, x, and y.