Skip to content

Commit f2d5af9

Browse files
authored
fix(morphsummon.cpp): mage condition, closes #19 (#22)
* fix(morphsummon.cpp): mage condition, closes #19 * ci: do not run build twice for PRs
1 parent 1954c92 commit f2d5af9

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.github/workflows/core-build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: core-build
22
on:
33
push:
4+
branches:
5+
- 'master'
46
pull_request:
57
workflow_dispatch:
68

src/morphsummon.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,15 @@ class MorphSummonCreatureScript : public CreatureScript
258258
bool sorry = false;
259259

260260
// Mage Pet (minion)
261-
if (Minion* minion = player->GetFirstMinion())
262-
{
263-
if (minion->GetUInt32Value(UNIT_CREATED_BY_SPELL) == SUMMON_WATER_ELEMENTAL)
261+
if (player->getClass() == CLASS_MAGE) {
262+
if (Minion* minion = player->GetFirstMinion())
264263
{
265-
if (!mage_water_elemental.empty())
264+
if (minion->GetUInt32Value(UNIT_CREATED_BY_SPELL) == SUMMON_WATER_ELEMENTAL)
266265
{
267-
AddGossipItemFor(player, MORPH_GOSSIP_MENU_HELLO, MORPH_GOSSIP_OPTION_POLYMORPH, GOSSIP_SENDER_MAIN, MORPH_PAGE_START_MAGE_WATER_ELEMENTAL);
266+
if (!mage_water_elemental.empty())
267+
{
268+
AddGossipItemFor(player, MORPH_GOSSIP_MENU_HELLO, MORPH_GOSSIP_OPTION_POLYMORPH, GOSSIP_SENDER_MAIN, MORPH_PAGE_START_MAGE_WATER_ELEMENTAL);
269+
}
268270
}
269271
}
270272
}

0 commit comments

Comments
 (0)