diff options
author | megamage <none@none> | 2009-05-27 12:42:38 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-05-27 12:42:38 -0500 |
commit | ffca6ec384419fab9b9217fc39e922f47c5d65ba (patch) | |
tree | 2c60a1ee02be20e85ccb08aa362d0bc8a3fd6736 | |
parent | 75942caacb0f098b26e77260a8821fe853091122 (diff) |
*Change vehicle faction the same as the driver's when driver enters it.
*Fix 3593 sql.
--HG--
branch : trunk
-rw-r--r-- | sql/updates/3467_world_spellclick_(dk).sql | 8 | ||||
-rw-r--r-- | sql/updates/3593_world_spellclick_(dk).sql | 3 | ||||
-rw-r--r-- | src/game/Unit.cpp | 12 | ||||
-rw-r--r-- | src/game/Vehicle.cpp | 2 |
4 files changed, 16 insertions, 9 deletions
diff --git a/sql/updates/3467_world_spellclick_(dk).sql b/sql/updates/3467_world_spellclick_(dk).sql new file mode 100644 index 00000000000..52cc8eb4459 --- /dev/null +++ b/sql/updates/3467_world_spellclick_(dk).sql @@ -0,0 +1,8 @@ +ALTER TABLE `npc_spellclick_spells` + ADD COLUMN `quest_status` int(11) UNSIGNED NOT NULL DEFAULT 3 COMMENT 'Quest status: 3 incompleted, 1 completed/rewarded' AFTER `quest_id`; + +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN ('29501', '29488'); +INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `quest_id`, `quest_status`, `cast_flags`) VALUES +('29488', '54568', '12670', '1', '3'), +('29501', '54575', '12670', '1', '3'); + diff --git a/sql/updates/3593_world_spellclick_(dk).sql b/sql/updates/3593_world_spellclick_(dk).sql index 52cc8eb4459..5c31fcf65a3 100644 --- a/sql/updates/3593_world_spellclick_(dk).sql +++ b/sql/updates/3593_world_spellclick_(dk).sql @@ -1,6 +1,3 @@ -ALTER TABLE `npc_spellclick_spells` - ADD COLUMN `quest_status` int(11) UNSIGNED NOT NULL DEFAULT 3 COMMENT 'Quest status: 3 incompleted, 1 completed/rewarded' AFTER `quest_id`; - DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN ('29501', '29488'); INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `quest_id`, `quest_status`, `cast_flags`) VALUES ('29488', '54568', '12670', '1', '3'), diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e2db82879a4..ad210ad8fd6 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -13626,16 +13626,16 @@ void Unit::RestoreFaction() ((Player*)this)->setFactionForRace(getRace()); else { - CreatureInfo const *cinfo = ((Creature*)this)->GetCreatureInfo(); - - if(((Creature*)this)->isPet()) + if(((Creature*)this)->HasSummonMask(SUMMON_MASK_MINION)) { if(Unit* owner = GetOwner()) + { setFaction(owner->getFaction()); - else if(cinfo) - setFaction(cinfo->faction_A); + return; + } } - else if(cinfo) // normal creature + + if(CreatureInfo const *cinfo = ((Creature*)this)->GetCreatureInfo()) // normal creature setFaction(cinfo->faction_A); } } diff --git a/src/game/Vehicle.cpp b/src/game/Vehicle.cpp index bfc87011761..0bcdf088bc2 100644 --- a/src/game/Vehicle.cpp +++ b/src/game/Vehicle.cpp @@ -245,6 +245,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId) if(seat->first == 0 && seat->second.seatInfo->IsUsable()) // not right { + setFaction(unit->getFaction()); ((Player*)unit)->SetCharm(this, true); ((Player*)unit)->SetViewpoint(this, true); ((Player*)unit)->VehicleSpellInitialize(); @@ -289,6 +290,7 @@ void Vehicle::RemovePassenger(Unit *unit) if(unit->GetTypeId() == TYPEID_PLAYER && seat->first == 0 && seat->second.seatInfo->IsUsable()) { + RestoreFaction(); ((Player*)unit)->SetCharm(this, false); ((Player*)unit)->SetViewpoint(this, false); ((Player*)unit)->SendRemoveControlBar(); |