Mercurial > mm7
diff Indoor.cpp @ 466:91e1ba340f39
Слияние
author | Ritor1 |
---|---|
date | Mon, 25 Feb 2013 09:09:08 +0600 |
parents | 4f451a616d3d |
children | 0dbf780e247f |
line wrap: on
line diff
--- a/Indoor.cpp Mon Feb 25 09:08:13 2013 +0600 +++ b/Indoor.cpp Mon Feb 25 09:09:08 2013 +0600 @@ -1794,15 +1794,10 @@ const char *v1; // edi@1 signed int v2; // esi@1 - v1 = Str1; - v2 = 0; - while ( _strcmpi(v1, _4E6BDC_loc_names[v2]) ) - { - ++v2; - if ( v2 >= 11 ) - return 0; - } - return v2 + 1; + for (uint i = 0; i < 11; ++i) + if (!strcmpi(Str1, _4E6BDC_loc_names[i])) + return i + 1; + return 0; } @@ -2890,7 +2885,7 @@ { memcpy(v203, pData, 0x36B); LABEL_132: - free(File); + free(pRawDLV); dlv.uLastRepawnDay = a3; if (_v244) ++dlv.uNumRespawns; @@ -2901,7 +2896,7 @@ auto v155 = header.uCompressedSize; auto Count = header.uDecompressedSize; auto Src = (BLVFace *)malloc(header.uDecompressedSize); - File = (FILE *)Src; + pRawDLV = Src; if ( v155 <= Count ) { if ( v155 == Count ) @@ -3458,32 +3453,27 @@ } //----- (0044C23B) -------------------------------------------------------- -int BLVFaceExtra::HasEventint() -{ - signed int v1; // eax@1 - EventIndex *v2; // esi@2 - signed int result; // eax@5 - signed int v4; // eax@6 - - v1 = 0; - if ( (signed int)(uLevelEVT_NumEvents - 1) <= 0 ) - goto LABEL_5; - v2 = pLevelEVT_Index; - while ( v2->uEventID != this->uEventID ) +bool BLVFaceExtra::HasEventint() + { + signed int event_index; // eax@1 + _evt_raw* start_evt; + _evt_raw* end_evt; + + event_index = 0; + if ( (uLevelEVT_NumEvents - 1) <= 0 ) + return false; + while ( pLevelEVT_Index[event_index].uEventID != this->uEventID ) { - ++v1; - ++v2; - if ( v1 >= (signed int)(uLevelEVT_NumEvents - 1) ) - goto LABEL_5; + ++event_index; + if ( event_index >= (signed int)(uLevelEVT_NumEvents - 1) ) + return false; } - v4 = v1; - if ( pLevelEVT[pLevelEVT_Index[v4 + 1].uEventOffsetInEVT + 4] != 1 - || pLevelEVT[pLevelEVT_Index[v4].uEventOffsetInEVT + 4] != 4 ) -LABEL_5: - result = 0; + end_evt=(_evt_raw*)&pLevelEVT[pLevelEVT_Index[event_index+1].uEventOffsetInEVT]; + start_evt=(_evt_raw*)&pLevelEVT[pLevelEVT_Index[event_index].uEventOffsetInEVT]; + if ( (end_evt->_e_type != EVENT_Exit) || (start_evt->_e_type!= EVENT_MouseOver) ) + return false; else - result = 1; - return result; + return true; } @@ -4148,7 +4138,7 @@ { do { - v54 = ai_array_4F7DB0_actor_ids[v25]; + v54 = ai_near_actors_ids[v25]; if ( v54 != v63 ) { v26 = v54; @@ -4345,7 +4335,7 @@ goto LABEL_119; } } - Actor::_403F58(v63, 4, v22, &v53); + Actor::AI_StandOrBored(v63, 4, v22, &v53); goto LABEL_119; } if ( v0->vPosition.x & 1 ) @@ -4359,7 +4349,7 @@ goto LABEL_123; if ( !v0->pMonsterInfo.uHostilityType || v56 != v22 ) { - Actor::_403F58(v63, 4, v22, &v52); + Actor::AI_StandOrBored(v63, 4, v22, &v52); goto LABEL_123; } } @@ -4616,7 +4606,7 @@ if ( !(pDecortaion->field_2 & 0x20) ) { v17 = &pDecorationList->pDecorations[pDecortaion->uDecorationDescID]; - if ( !((unsigned __int8)2 & v17->uFlags) ) + if (!v17->DontDraw()) { v18 = v17->uLightRadius; if ( v18 ) @@ -4670,8 +4660,8 @@ if (uItemID) { if (uItemID != 220 && pItemsTable->pItems[uItemID].uEquipType == EQUIP_POTION && - !p->stru_24._bonus_type) - p->stru_24._bonus_type = rand() % 15 + 5; + !p->stru_24.uEncantmentType) + p->stru_24.uEncantmentType = rand() % 15 + 5; pItemsTable->SetSpecialBonus(&p->stru_24); } }