Mercurial > mm7
diff Engine/Graphics/Indoor.cpp @ 2567:d569340b05ff
Few constants changed into enum values
author | a.parshin |
---|---|
date | Thu, 21 May 2015 01:50:59 +0200 |
parents | 30eb6dcac768 |
children | d87bfbd3bb3b |
line wrap: on
line diff
--- a/Engine/Graphics/Indoor.cpp Wed May 20 21:05:07 2015 +0200 +++ b/Engine/Graphics/Indoor.cpp Thu May 21 01:50:59 2015 +0200 @@ -34,7 +34,7 @@ #include "Lights.h" #include "Sprites.h" -#include "stru6.h" +#include "Engine/stru6.h" #include "ParticleEngine.h" #include "../texts.h" #include "GUI/GUIWindow.h" @@ -4445,75 +4445,36 @@ { int v17; // edi@36 - v17 = PID_ID(a1); - switch ( PID_TYPE(a1) ) - { - case OBJECT_Item: // take the item - if ( pObjectList->pObjects[pSpriteObjects[v17].uObjectDescID].uFlags & 0x10 || v17 >= 1000 || !pSpriteObjects[v17].uObjectDescID ) - return 1; - if (pItemsTable->pItems[pSpriteObjects[v17].containing_item.uItemID].uEquipType == EQUIP_GOLD) - { - pParty->PartyFindsGold(pSpriteObjects[v17].containing_item.uSpecEnchantmentType, 0); - viewparams->bRedrawGameUI = 1; - } - else - { - if ( pParty->pPickedItem.uItemID ) - return 1; - sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[pSpriteObjects[v17].containing_item.uItemID].pUnidentifiedName);//You found an item (%s)! - ShowStatusBarString(pTmpBuf2.data(), 2); - if (pSpriteObjects[v17].containing_item.uItemID == 506)//artefact - _449B7E_toggle_bit(pParty->_quest_bits, 184, 1); - if (pSpriteObjects[v17].containing_item.uItemID == 455) - _449B7E_toggle_bit(pParty->_quest_bits, 185, 1); - if (!pParty->AddItemToParty(&pSpriteObjects[v17].containing_item)) - pParty->SetHoldingItem(&pSpriteObjects[v17].containing_item); - } - SpriteObject::OnInteraction(v17); - break; + v17 = PID_ID(a1); + switch ( PID_TYPE(a1) ) + { + case OBJECT_Item: // take the item + { + if (pObjectList->pObjects[pSpriteObjects[v17].uObjectDescID].uFlags & 0x10 + || v17 >= 1000 + || !pSpriteObjects[v17].uObjectDescID) + return 1; + + extern void ItemInteraction(unsigned int item_id); + ItemInteraction(v17); + break; + } case OBJECT_Actor: if ( pActors[v17].uAIState == Dying || pActors[v17].uAIState == Summoned ) return 1; - if ( pActors[v17].uAIState == Dead ) - pActors[v17].LootActor(); + if (pActors[v17].uAIState == Dead) + pActors[v17].LootActor(); else { - if ( !pActors[v17].GetActorsRelation(0) && pActors[v17].ActorFriend() && pActors[v17].CanAct() ) - { - Actor::AI_FaceObject(v17, 4, 0, 0); - if ( pActors[v17].sNPC_ID ) - pMessageQueue_50CBD0->AddGUIMessage(UIMSG_StartNPCDialogue, v17, 0); - else - { - if ( pNPCStats->pGroups_copy[pActors[v17].uGroup] ) - { - if ( pNPCStats->pCatchPhrases[pNPCStats->pGroups_copy[pActors[v17].uGroup]] ) - { - pParty->uFlags |= 2; - strcpy(byte_5B0938.data(), pNPCStats->pCatchPhrases[pNPCStats->pGroups_copy[pActors[v17].uGroup]]); - sub_4451A8_press_any_key(0, 0, 0); - } - } - } - } + extern bool ActorInteraction(unsigned int id); + ActorInteraction(v17); } break; case OBJECT_Decoration: - if ( pLevelDecorations[v17].uEventID ) - { - EventProcessor(pLevelDecorations[v17].uEventID, a1, 1); - pLevelDecorations[v17].uFlags |= LEVEL_DECORATION_VISIBLE_ON_MAP; - } - else - { - if ( !pLevelDecorations[v17].IsInteractive() ) - return 1; - activeLevelDecoration = &pLevelDecorations[v17]; - EventProcessor(stru_5E4C90_MapPersistVars._decor_events[pLevelDecorations[v17]._idx_in_stru123 - 75] + 380, 0, 1); - activeLevelDecoration = nullptr; - } + extern void DecorationInteraction(unsigned int id, unsigned int pid); + DecorationInteraction(v17, a1); break; default: