Mercurial > mm7
comparison mm7_1.cpp @ 588:829fb49eee05
OnGameViewportClick cleaned partly
author | zipi |
---|---|
date | Wed, 06 Mar 2013 12:43:58 +0000 |
parents | fb0e105683e9 |
children | 55d6b756e03a |
comparison
equal
deleted
inserted
replaced
587:fb0e105683e9 | 588:829fb49eee05 |
---|---|
4890 return; | 4890 return; |
4891 } | 4891 } |
4892 | 4892 |
4893 if (!player->CanAct()) | 4893 if (!player->CanAct()) |
4894 { | 4894 { |
4895 if ( pPlayers[uActiveCharacter]->CanAct()) | |
4896 goto LABEL_9; | |
4897 player = pPlayers[uActiveCharacter]; | 4895 player = pPlayers[uActiveCharacter]; |
4898 } | 4896 } |
4899 player->PlaySound(SPEECH_NoRoom, 0); | 4897 if(playerCanAct() || !pPlayers[uActiveCharacter]->CanAct()) |
4900 } | 4898 player->PlaySound(SPEECH_NoRoom, 0); |
4901 | 4899 } |
4902 LABEL_9: | 4900 |
4901 //LABEL_9: | |
4903 if (pCurrentScreen == SCREEN_GAME) | 4902 if (pCurrentScreen == SCREEN_GAME) |
4904 { | 4903 { |
4905 viewparams->bRedrawGameUI = true; | 4904 viewparams->bRedrawGameUI = true; |
4906 if ( uActiveCharacter != uPlayerID ) | 4905 if ( uActiveCharacter != uPlayerID ) |
4907 //goto LABEL_27; | 4906 //goto LABEL_27; |
5057 if ( !v8 ) | 5056 if ( !v8 ) |
5058 return; | 5057 return; |
5059 memcpy(&pParty->pPickedItem, &v0->pInventoryItems[v8-1], sizeof(pParty->pPickedItem)); | 5058 memcpy(&pParty->pPickedItem, &v0->pInventoryItems[v8-1], sizeof(pParty->pPickedItem)); |
5060 v0->RemoveItemAtInventoryIndex(a4); | 5059 v0->RemoveItemAtInventoryIndex(a4); |
5061 v9 = pParty->pPickedItem.uItemID; | 5060 v9 = pParty->pPickedItem.uItemID; |
5062 goto LABEL_24; | 5061 pMouse->SetCursorBitmap(pItemsTable->pItems[v9].pIconName); |
5062 return; | |
5063 } | 5063 } |
5064 v13 = v8; | 5064 v13 = v8; |
5065 if ( v8 ) | 5065 if ( v8 ) |
5066 { | 5066 { |
5067 a2.y = (LONG)&v0->pInventoryItems[v8-1]; | 5067 a2.y = (LONG)&v0->pInventoryItems[v8-1]; |
5078 return; | 5078 return; |
5079 } | 5079 } |
5080 } | 5080 } |
5081 v9 = this_.uItemID; | 5081 v9 = this_.uItemID; |
5082 memcpy(&pParty->pPickedItem, &this_, sizeof(pParty->pPickedItem)); | 5082 memcpy(&pParty->pPickedItem, &this_, sizeof(pParty->pPickedItem)); |
5083 LABEL_24: | |
5084 pMouse->SetCursorBitmap(pItemsTable->pItems[v9].pIconName); | 5083 pMouse->SetCursorBitmap(pItemsTable->pItems[v9].pIconName); |
5085 return; | 5084 return; |
5086 } | 5085 } |
5087 v10 = v0->AddItem(a4, v7); | 5086 v10 = v0->AddItem(a4, v7); |
5088 pX = v10; | 5087 pX = v10; |
5164 pParty->SetHoldingItem(v22); | 5163 pParty->SetHoldingItem(v22); |
5165 } | 5164 } |
5166 SpriteObject::OnInteraction(a2.y); | 5165 SpriteObject::OnInteraction(a2.y); |
5167 return; | 5166 return; |
5168 } | 5167 } |
5169 goto LABEL_13; | 5168 v4 = pParty->pPickedItem.uItemID; |
5169 if ( !pParty->pPickedItem.uItemID ) | |
5170 return; | |
5171 goto LABEL_14; | |
5170 } | 5172 } |
5171 if ( (v0 & 7) != OBJECT_Actor) | 5173 if ( (v0 & 7) != OBJECT_Actor) |
5172 { | 5174 { |
5173 if ( (v0 & 7) == OBJECT_Decoration) | 5175 if ( (v0 & 7) == OBJECT_Decoration) |
5174 { | 5176 { |
5175 v13 = &pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3]; | 5177 v13 = &pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3]; |
5176 if ( (signed int)(((unsigned int)v0 >> 16) - pDecorationList->pDecorations[v13->uDecorationDescID].uRadius) >= 512 ) | 5178 if ( (signed int)(((unsigned int)v0 >> 16) - pDecorationList->pDecorations[v13->uDecorationDescID].uRadius) >= 512 ) |
5177 goto LABEL_13; | 5179 { |
5180 v4 = pParty->pPickedItem.uItemID; | |
5181 if ( !pParty->pPickedItem.uItemID ) | |
5182 return; | |
5183 goto LABEL_14; | |
5184 } | |
5178 v14 = v13->field_16_event_id; | 5185 v14 = v13->field_16_event_id; |
5179 if ( !v14 ) | 5186 if ( !v14 ) |
5180 { | 5187 { |
5181 if ( pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3].IsInteractive() ) | 5188 if ( pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3].IsInteractive() ) |
5182 { | 5189 { |
5190 v11 = v14; | 5197 v11 = v14; |
5191 } | 5198 } |
5192 else | 5199 else |
5193 { | 5200 { |
5194 if ( (v0 & 7) != OBJECT_BModel || (unsigned int)v0 >= 0x2000000 ) | 5201 if ( (v0 & 7) != OBJECT_BModel || (unsigned int)v0 >= 0x2000000 ) |
5195 goto LABEL_13; | 5202 { |
5203 v4 = pParty->pPickedItem.uItemID; | |
5204 if ( !pParty->pPickedItem.uItemID ) | |
5205 return; | |
5206 goto LABEL_14; | |
5207 } | |
5196 v2 = (signed int)(unsigned __int16)v0 >> 3; | 5208 v2 = (signed int)(unsigned __int16)v0 >> 3; |
5197 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | 5209 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) |
5198 { | 5210 { |
5199 v3 = &pIndoor->pFaces[v2]; | 5211 v3 = &pIndoor->pFaces[v2]; |
5200 if ( !(v3->uAttributes & 0x2000000) ) | 5212 if ( !(v3->uAttributes & 0x2000000) ) |
5201 { | 5213 { |
5202 LABEL_11: | 5214 LABEL_11: |
5203 v4 = pParty->pPickedItem.uItemID; | 5215 v4 = pParty->pPickedItem.uItemID; |
5204 if ( pParty->pPickedItem.uItemID ) | 5216 if ( !pParty->pPickedItem.uItemID ) |
5205 { | 5217 { |
5218 ShowNothingHereStatus(); | |
5219 v4 = pParty->pPickedItem.uItemID; | |
5220 if ( !pParty->pPickedItem.uItemID ) | |
5221 return; | |
5222 } | |
5206 LABEL_14: | 5223 LABEL_14: |
5207 v5 = pItemsTable->pItems[v4].uSpriteID; | 5224 v5 = pItemsTable->pItems[v4].uSpriteID; |
5208 v6 = 0; | 5225 v6 = 0; |
5209 a1.uType = v5; | 5226 a1.uType = v5; |
5210 if ( (signed int)pObjectList->uNumObjects <= 0 ) | 5227 if ( (signed int)pObjectList->uNumObjects <= 0 ) |
5211 { | 5228 { |
5212 LABEL_18: | 5229 LOWORD(v6) = 0; |
5213 LOWORD(v6) = 0; | 5230 } |
5214 } | 5231 else |
5215 else | 5232 { |
5216 { | 5233 v7 = (char *)&pObjectList->pObjects->uObjectID; |
5217 v7 = (char *)&pObjectList->pObjects->uObjectID; | 5234 while ( v5 != *(short *)v7 ) |
5218 while ( v5 != *(short *)v7 ) | 5235 { |
5219 { | 5236 ++v6; |
5220 ++v6; | 5237 v7 += 56; |
5221 v7 += 56; | 5238 if ( v6 >= (signed int)pObjectList->uNumObjects ) |
5222 if ( v6 >= (signed int)pObjectList->uNumObjects ) | 5239 { |
5223 goto LABEL_18; | 5240 LOWORD(v6) = 0; |
5224 } | 5241 break; |
5225 } | 5242 } |
5226 a1.uObjectDescID = v6; | 5243 } |
5227 a1.vPosition.y = pParty->vPosition.y; | 5244 } |
5228 a1.field_58_pid = OBJECT_Player; | 5245 a1.uObjectDescID = v6; |
5229 a1.vPosition.x = pParty->vPosition.x; | 5246 a1.vPosition.y = pParty->vPosition.y; |
5230 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z; | 5247 a1.field_58_pid = OBJECT_Player; |
5231 a1.uSoundID = 0; | 5248 a1.vPosition.x = pParty->vPosition.x; |
5232 a1.uFacing = 0; | 5249 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z; |
5233 a1.uAttributes = 8; | 5250 a1.uSoundID = 0; |
5234 a1.uSectorID = pIndoor->GetSector( | 5251 a1.uFacing = 0; |
5235 pParty->vPosition.x, | 5252 a1.uAttributes = 8; |
5236 pParty->vPosition.y, | 5253 a1.uSectorID = pIndoor->GetSector( |
5237 pParty->sEyelevel + pParty->vPosition.z); | 5254 pParty->vPosition.x, |
5238 a1.uSpriteFrameID = 0; | 5255 pParty->vPosition.y, |
5239 memcpy(&a1.stru_24, &pParty->pPickedItem, 0x24u); | 5256 pParty->sEyelevel + pParty->vPosition.z); |
5240 v8 = (int *)pMouse->GetCursorPos(&v25); | 5257 a1.uSpriteFrameID = 0; |
5241 v9 = UnprojectX(*v8); | 5258 memcpy(&a1.stru_24, &pParty->pPickedItem, 0x24u); |
5242 a1.Create(pParty->sRotationY + v9, 184, 200, 0); | 5259 v8 = (int *)pMouse->GetCursorPos(&v25); |
5243 v10 = pIcons_LOD->LoadTexture( | 5260 v9 = UnprojectX(*v8); |
5244 pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName, | 5261 a1.Create(pParty->sRotationY + v9, 184, 200, 0); |
5245 TEXTURE_16BIT_PALETTE); | 5262 v10 = pIcons_LOD->LoadTexture( |
5246 if (v10 != -1) | 5263 pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName, |
5247 pIcons_LOD->pTextures[v10].Release(); | 5264 TEXTURE_16BIT_PALETTE); |
5248 pMouse->RemoveHoldingItem(); | 5265 if (v10 != -1) |
5249 pIcons_LOD->_40F9C5(); | 5266 pIcons_LOD->pTextures[v10].Release(); |
5250 return; | 5267 pMouse->RemoveHoldingItem(); |
5251 } | 5268 pIcons_LOD->_40F9C5(); |
5252 ShowNothingHereStatus(); | 5269 return; |
5253 LABEL_13: | 5270 } |
5271 v11 = pIndoor->pFaceExtras[v3->uFaceExtraID].uEventID; | |
5272 } | |
5273 else | |
5274 { | |
5275 v12 = &pOutdoor->pBModels[(signed int)(unsigned __int16)v0 >> 9].pFaces[v2 & 0x3F]; | |
5276 if ( !(v12->uAttributes & 0x2000000) ) | |
5277 goto LABEL_11; | |
5278 v11 = v12->sCogTriggeredID; | |
5279 } | |
5280 } | |
5281 EventProcessor(v11, (unsigned __int16)v0, 1); | |
5282 return; | |
5283 } | |
5284 v16 = (signed int)(unsigned __int16)v0 >> 3; | |
5285 a2.y = v16; | |
5286 v17 = &pActors[v16]; | |
5287 if ( v17->uAIState == 5 ) | |
5288 { | |
5289 if ( (unsigned int)v0 < 0x2000000 ) | |
5290 { | |
5291 stru_50C198.LootActor(&pActors[v16]); | |
5292 return; | |
5293 } | |
5294 v4 = pParty->pPickedItem.uItemID; | |
5295 if ( !pParty->pPickedItem.uItemID ) | |
5296 return; | |
5297 goto LABEL_14; | |
5298 } | |
5299 if ( GetAsyncKeyState(VK_SHIFT) >= 0 ) | |
5300 { | |
5301 if ( !v17->GetActorsRelation(0) && !(BYTE2(v17->uAttributes) & 8) ) | |
5302 { | |
5303 if ( (unsigned int)v0 >= 0x2000000 ) | |
5304 { | |
5254 v4 = pParty->pPickedItem.uItemID; | 5305 v4 = pParty->pPickedItem.uItemID; |
5255 if ( !pParty->pPickedItem.uItemID ) | 5306 if ( !pParty->pPickedItem.uItemID ) |
5256 return; | 5307 return; |
5257 goto LABEL_14; | 5308 goto LABEL_14; |
5258 } | 5309 } |
5259 v11 = pIndoor->pFaceExtras[v3->uFaceExtraID].uEventID; | |
5260 } | |
5261 else | |
5262 { | |
5263 v12 = &pOutdoor->pBModels[(signed int)(unsigned __int16)v0 >> 9].pFaces[v2 & 0x3F]; | |
5264 if ( !(v12->uAttributes & 0x2000000) ) | |
5265 goto LABEL_11; | |
5266 v11 = v12->sCogTriggeredID; | |
5267 } | |
5268 } | |
5269 EventProcessor(v11, (unsigned __int16)v0, 1); | |
5270 return; | |
5271 } | |
5272 v16 = (signed int)(unsigned __int16)v0 >> 3; | |
5273 a2.y = v16; | |
5274 v17 = &pActors[v16]; | |
5275 if ( v17->uAIState == 5 ) | |
5276 { | |
5277 if ( (unsigned int)v0 < 0x2000000 ) | |
5278 { | |
5279 stru_50C198.LootActor(&pActors[v16]); | |
5280 return; | |
5281 } | |
5282 goto LABEL_13; | |
5283 } | |
5284 if ( GetAsyncKeyState(VK_SHIFT) >= 0 ) | |
5285 { | |
5286 if ( !v17->GetActorsRelation(0) && !(BYTE2(v17->uAttributes) & 8) ) | |
5287 { | |
5288 if ( (unsigned int)v0 >= 0x2000000 ) | |
5289 goto LABEL_13; | |
5290 if ( !v17->CanAct() ) | 5310 if ( !v17->CanAct() ) |
5291 return; | 5311 return; |
5292 v18 = a2.y; | 5312 v18 = a2.y; |
5293 Actor::FaceObject(a2.y, 4u, 0, 0); | 5313 Actor::FaceObject(a2.y, 4u, 0, 0); |
5294 if ( !v17->uNPC_ID ) | 5314 if ( !v17->uNPC_ID ) |