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

Function On_TSPELLID

Source/msg.cpp:1955–1973  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1953}
1954
1955DWORD On_TSPELLID(TCmd *pCmd, int pnum)
1956{
1957 TCmdParam3 *p = (TCmdParam3 *)pCmd;
1958
1959 if (gbBufferMsgs != 1 && currlevel == plr[pnum].plrlevel) {
1960 if (currlevel != 0 || spelldata[p->wParam2].sTownSpell) {
1961 ClrPlrPath(pnum);
1962 plr[pnum].destAction = ACTION_SPELLMON;
1963 plr[pnum].destParam1 = p->wParam1;
1964 plr[pnum].destParam2 = p->wParam3;
1965 plr[pnum]._pSpell = p->wParam2;
1966 plr[pnum]._pSplType = plr[pnum]._pTSplType;
1967 plr[pnum]._pSplFrom = 2;
1968 } else
1969 msg_errorf("%s has cast an illegal spell.", plr[pnum]._pName);
1970 }
1971
1972 return sizeof(*p);
1973}
1974
1975DWORD On_TSPELLPID(TCmd *pCmd, int pnum)
1976{

Callers 1

ParseCmdFunction · 0.85

Calls 2

ClrPlrPathFunction · 0.85
msg_errorfFunction · 0.85

Tested by

no test coverage detected