mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 23:20:25 +00:00
[Quest API] (Performance) Check event EVENT_ITEM_TICK or EVENT_WEAPON_PROC exist before export and execute (#2914)
* [Quest API] Optionally parse EVENT_ITEM_TICK # Notes - Optionally parse this event instead of always doing so. * Update mob.cpp
This commit is contained in:
+13
-3
@@ -4139,9 +4139,19 @@ void Mob::ExecWeaponProc(const EQ::ItemInstance *inst, uint16 spell_id, Mob *on,
|
||||
//const cast is dirty but it would require redoing a ton of interfaces at this point
|
||||
//It should be safe as we don't have any truly const EQ::ItemInstance floating around anywhere.
|
||||
//So we'll live with it for now
|
||||
int i = parse->EventItem(EVENT_WEAPON_PROC, CastToClient(), const_cast<EQ::ItemInstance*>(inst), on, "", spell_id);
|
||||
if(i != 0) {
|
||||
return;
|
||||
if (parse->ItemHasQuestSub(const_cast<EQ::ItemInstance*>(inst), EVENT_WEAPON_PROC)) {
|
||||
int i = parse->EventItem(
|
||||
EVENT_WEAPON_PROC,
|
||||
CastToClient(),
|
||||
const_cast<EQ::ItemInstance*>(inst),
|
||||
on,
|
||||
"",
|
||||
spell_id
|
||||
);
|
||||
|
||||
if (i != 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user