MCPcopy Create free account
hub / github.com/diasurgical/devilution / On_AWAKEGOLEM

Function On_AWAKEGOLEM

Source/msg.cpp:2103–2127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2101}
2102
2103DWORD On_AWAKEGOLEM(TCmd *pCmd, int pnum)
2104{
2105 TCmdGolem *p = (TCmdGolem *)pCmd;
2106
2107 if (gbBufferMsgs == 1)
2108 msg_send_packet(pnum, p, sizeof(*p));
2109 else if (currlevel != plr[pnum].plrlevel)
2110 delta_sync_golem(p, pnum, p->_currlevel);
2111 else if (pnum != myplr) {
2112 int i;
2113 // check if this player already has an active golem
2114 BOOL addGolem = TRUE;
2115 for (i = 0; i < nummissiles; i++) {
2116 int mi = missileactive[i];
2117 if (missile[mi]._mitype == MIS_GOLEM && missile[mi]._misource == pnum) {
2118 addGolem = FALSE;
2119 // BUGFIX: break, don't need to check the rest
2120 }
2121 }
2122 if (addGolem)
2123 AddMissile(plr[pnum].WorldX, plr[pnum].WorldY, p->_mx, p->_my, p->_mdir, MIS_GOLEM, 0, pnum, 0, 1);
2124 }
2125
2126 return sizeof(*p);
2127}
2128
2129DWORD On_MONSTDAMAGE(TCmd *pCmd, int pnum)
2130{

Callers 1

ParseCmdFunction · 0.85

Calls 3

msg_send_packetFunction · 0.85
delta_sync_golemFunction · 0.85
AddMissileFunction · 0.85

Tested by

no test coverage detected