changeset 525:e7b3fa10d58d

events cleanup
author Gloval
date Sat, 02 Mar 2013 15:38:49 +0400
parents 5196a51cc9ec
children 214d9d47cf1f d6711da258f1
files Events.cpp
diffstat 1 files changed, 65 insertions(+), 158 deletions(-) [+]
line wrap: on
line diff
--- a/Events.cpp	Sat Mar 02 01:37:06 2013 +0200
+++ b/Events.cpp	Sat Mar 02 15:38:49 2013 +0400
@@ -338,9 +338,6 @@
 					{
 					++curr_seq_num;
 					v4 = v124;
-					
-					//v6 = v123;
-					//v7 = "";
 					break;
 					}
 				v124 = -1;
@@ -533,19 +530,16 @@
 					{
 					v26 = (LevelDecoration *)activeLevelDecoration;
 					stru_5E4C90._decor_events[activeLevelDecoration ->_idx_in_stru123] = 0;
-					LOBYTE(v26->field_2) |= 0x20u;
+					v26->field_2 |= 0x0020;
 					}
 				++curr_seq_num;
 				v4 = v124;
-				
-				//v6 = v123;
-				//v7 = "";
+
 				break;
 			case EVENT_SetNPCGreeting:
-				v27 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
-				v28 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
+				v27 = EVT_DWORD(_evt->v5);
 				pNPCStats->pNewNPCData[v27].uFlags &= 0xFFFFFFFCu;
-				pNPCStats->pNewNPCData[v27].greet = v28;
+				pNPCStats->pNewNPCData[v27].greet = EVT_DWORD(_evt->v9);
 				++curr_seq_num;
 				v4 = v124;
 				
@@ -629,39 +623,26 @@
 				//v7 = "";
 				break;
 			case EVENT_NPCSetItem:
-				sub_448518_npc_set_item(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
-					_evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13);
+				sub_448518_npc_set_item(EVT_DWORD(_evt->v5),EVT_DWORD(_evt->v9), _evt->v13);
 				++curr_seq_num;
 				v4 = v124;
-				
-				//v6 = v123;
-				//v7 = "";
+
 				break;
 			case EVENT_SetActorItem:
-				Actor::GiveItem(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
-					_evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13);
+				Actor::GiveItem(EVT_DWORD(_evt->v5),EVT_DWORD(_evt->v9), _evt->v13);
 				++curr_seq_num;
 				v4 = v124;
-				
-				//v6 = v123;
-				//v7 = "";
 				break;
 			case EVENT_SetNPCGroupNews:
 				pNPCStats->pGroups_copy[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)] = _evt->v9 + ((uint)_evt->v10 << 8);
 				++curr_seq_num;
 				v4 = v124;
-				
-				//v6 = v123;
-				//v7 = "";
 				break;
 			case EVENT_SetActorGroup:
 				__debugbreak();
 				*(&pActors[0].uGroup + 0x11000000 * _evt->v8 + 209 * (_evt->v5 + ((_evt->v6 + ((uint)_evt->v7 << 8)) << 8))) = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
 				++curr_seq_num;
 				v4 = v124;
-				
-				//v6 = v123;
-				//v7 = "";
 				break;
 			case EVENT_ChangeGroup:
 				v38 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
@@ -712,11 +693,11 @@
 			case EVENT_MoveNPC:
 				{
 
-				pNPCStats->pNewNPCData[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)].Location2D = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
+				pNPCStats->pNewNPCData[EVT_DWORD(_evt->v5)].Location2D =EVT_DWORD(_evt->v9);
 				if ( window_SpeakInHouse )
 					{
-					v46 = window_SpeakInHouse->ptr_1C;
-					if ( v46 == (void *)165 )
+	
+					if ( window_SpeakInHouse->par1C == 165 )
 						{
 						sub_4BD8B5();
 						pVideoPlayer->Unload();
@@ -726,9 +707,8 @@
 						if ( EnterHouse(HOUSE_BODY_GUILD_ERATHIA) )
 							{
 							pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
-							v47 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 165, 0);
-							window_SpeakInHouse = v47;
-							v48 = v47->pControlsHead;
+							window_SpeakInHouse = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 165, 0);
+							v48 = window_SpeakInHouse->pControlsHead;
 							if ( v48 )
 								{
 								do
@@ -738,33 +718,29 @@
 									v48 = v49;
 									}
 									while ( v49 );
-									v47 = window_SpeakInHouse;
 								}
-							v47->pControlsHead = 0;
+							window_SpeakInHouse->pControlsHead = 0;
 							window_SpeakInHouse->pControlsTail = 0;
 							window_SpeakInHouse->uNumControls = 0;
 							}
 						}
 					else
 						{
-						if ( v46 == (void *)553 )
+						if ( window_SpeakInHouse->par1C == 553 )
 							pVideoPlayer->bLoopPlaying = 0;
 						}
 					}
-				++curr_seq_num;
+				
 				}
+                ++curr_seq_num;
 				v4 = v124;
-				
-				//v6 = v123;
-				//v7 = "";
+
 				break;
 			case EVENT_Jmp:
 				curr_seq_num = _evt->v5 - 1;
 				++curr_seq_num;
-				//v4 = -1;
-				
-				//v6 = v123;
-				//v7 = "";
+				v4 = -1;
+
 				break;
 			case EVENT_ShowFace:
 				if ( _evt->v5 <= 3u ) //someone 
@@ -780,9 +756,7 @@
 					pParty->pPlayers[rand() % 4].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0);
 					++curr_seq_num;
 					v4 = v124;
-					
-					//v6 = v123;
-					//v7 = "";
+
 					break;
 			case EVENT_CharacterAnimation:
 				if ( _evt->v5 <= 3u ) //someone
@@ -795,18 +769,13 @@
 				else	//random
 					pParty->pPlayers[rand() % 4].PlaySound((PlayerSpeech) _evt->v6, 0);
 				++curr_seq_num;
-					v4 = v124;
-					
-					//v6 = v123;
-					//v7 = "";
+				v4 = v124;
+
 				break;
 			case EVENT_ForPartyMember:
 				player_choose = _evt->v5;
 				++curr_seq_num;
 				v4 = v124;
-				
-				//v6 = v123;
-				//v7 = "";
 				break;
 			case EVENT_SummonItem:
 				sub_42F7EB_DropItemAt(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
@@ -866,8 +835,6 @@
 				}
 				++curr_seq_num;
 				v4 = v124;
-				//v6 = v123;
-				//v7 = "";
 				break;
 			case EVENT_IsActorAlive:
 				 if  (IsActorAlive(EVT_BYTE(_evt->v5), EVT_DWORD(_evt->v6), EVT_BYTE(_evt->v10)))
@@ -979,9 +946,6 @@
 				{
 					pPlayer = &pParty->pPlayers[player_choose];
 					pPlayer->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
-					++curr_seq_num;
-					v4 = v124;
-					break;
 				}
 				else if ( player_choose == 4 ) //active
 				{
@@ -989,9 +953,6 @@
 					{
 						pPlayer = pPlayers[uActiveCharacter];
 						pPlayer->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
-						++curr_seq_num;
-						v4 = v124;
-						break;
 					}
 				}
 				else 	if ( player_choose == 5 )//all
@@ -1006,26 +967,22 @@
 						}
 					}
 					++v130;
-					break;
 				}
 				else if ( player_choose == 6 ) //random
 				{
 					player_choose = rand() % 4;
 					pPlayer = &pParty->pPlayers[player_choose];
 					pPlayer->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
-					++curr_seq_num;
-					v4 = v124;
-					break;
 				}
+                ++curr_seq_num;
+                v4 = v124;
+                break;
 			case EVENT_Set:
 				pValue = EVT_DWORD(_evt->v7);
 				if ( player_choose <= 3 )
 				{
 					pPlayer = &pParty->pPlayers[player_choose];
 					pPlayer->SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
-					++curr_seq_num;
-					v4 = v124;
-					break;
 				}
 				else if ( player_choose == 4 ) //active
 				{
@@ -1033,40 +990,31 @@
 					{
 						pPlayer = pPlayers[uActiveCharacter];
 						pPlayer->SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
-						++curr_seq_num;
-						v4 = v124;
-						break;
 					}
 				}
 				else if ( player_choose == 5 )//all
 				{
+                  //recheck v130
 					for(int i = 1; i < 5; ++i)
 						pPlayers[i]->SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
-					++curr_seq_num;
-					v4 = v124;
-					break;
+
 				}
 				else if ( player_choose == 6 ) //random
 				{
 					player_choose = rand() % 4;
 					pPlayer = &pParty->pPlayers[player_choose];
 					pPlayer->SetVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
-					++curr_seq_num;
-					v4 = v124;
-					break;
+
 				}
+                ++curr_seq_num;
+                v4 = v124;
+                break;
 			case EVENT_Add:
 				pValue = EVT_DWORD(_evt->v7);
 				if ( player_choose <= 3 )
 				{
 					pPlayer = &pParty->pPlayers[player_choose];
 					pPlayer->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
-					v83 = EVT_WORD(_evt->v5);
-					if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 )
-						viewparams->bRedrawGameUI = 1;
-					++curr_seq_num;
-					v4 = v124;
-					break;
 				}
 				else if ( player_choose == 4 ) //active
 				{
@@ -1074,12 +1022,6 @@
 					{
 						pPlayer = pPlayers[uActiveCharacter];
 						pPlayer->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
-						v83 = EVT_WORD(_evt->v5);
-						if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 )
-							viewparams->bRedrawGameUI = 1;
-						++curr_seq_num;
-						v4 = v124;
-						break;
 					}
 				}
 				else if ( player_choose == 5 )//all
@@ -1087,29 +1029,24 @@
 					//v130 = 0;
 					for(int i = 1; i < 5; ++i)
 						pPlayers[i]->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
-					v83 = EVT_WORD(_evt->v5);
-					if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 )
-						viewparams->bRedrawGameUI = 1;
-					++curr_seq_num;
-					v4 = v124;
-					break;
+
 				}
 				else if ( player_choose == 6 ) //random
 				{
 					player_choose = rand() % 4;
 					pPlayer = &pParty->pPlayers[player_choose];
 					pPlayer->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
-					v83 = EVT_WORD(_evt->v5);
-					if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 )
-						viewparams->bRedrawGameUI = 1;
-					++curr_seq_num;
-					v4 = v124;
-					break;
 				}
+                v83 = EVT_WORD(_evt->v5);
+                if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 )
+                    viewparams->bRedrawGameUI = 1;
+                ++curr_seq_num;
+                v4 = v124;
+                break;
 			case EVENT_InputString:
 				if ( !start_event_seq_number )
 					{
-					strcpy(GameUI_StatusBar_TimedString, &pLevelStr[pLevelStrOffsets[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)]]);
+					strcpy(GameUI_StatusBar_TimedString, &pLevelStr[pLevelStrOffsets[EVT_DWORD(_evt->v5 )]]);
 					v105 = curr_seq_num;
 					v121 = 26;
 LABEL_295:
@@ -1140,14 +1077,16 @@
 				//v124 = -1;
 				v11 = (unsigned __int8)*(&_evt->v5 + rand() % ((_evt->v5 != 0) + (_evt->v6 != 0) + (_evt->v7 != 0) + (_evt->v8 != 0) + (_evt->v9 != 0)
 					+ (_evt->v10 != 0)));
-				goto LABEL_131;
+                curr_seq_num = v11 - 1;
+                   ++curr_seq_num;
+                   v4 = v124;
 			case EVENT_ReceiveDamage:
-				v85 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
+				v85 = EVT_DWORD(_evt->v7 );
 				v86 = _evt->v5;
 				if ( (unsigned __int8)v86 <= 3u )
 					{
 					v119 = _evt->v6;
-					v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
+					v115 = EVT_DWORD(_evt->v7 );
 					v89 = (unsigned __int8)v86;
 					goto LABEL_233;
 					}
@@ -1164,13 +1103,13 @@
 						}
 					v119 = _evt->v6;
 					v88 = pPlayers[uActiveCharacter];
-					v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
+					v115 = EVT_DWORD(_evt->v7 );
 					goto LABEL_234;
 					}
 				if ( v86 != 5 )
 					{
 					v119 = _evt->v6;
-					v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10<< 8)) << 8)) << 8);
+					v115 = EVT_DWORD(_evt->v7 );
 					v89 = rand() % 4;
 LABEL_233:
 					v88 = &pParty->pPlayers[v89];
@@ -1197,7 +1136,7 @@
 					//v7 = "";
 					break;
 			case EVENT_ToggleIndoorLight:
-				pIndoor->ToggleLight(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9);
+				pIndoor->ToggleLight(EVT_DWORD(_evt->v5 ), _evt->v9);
 				++curr_seq_num;
 				v4 = v124;
 				
@@ -1205,8 +1144,7 @@
 				//v7 = "";
 				break;
 			case EVENT_SetFacesBit:
-				sub_44892E_set_faces_bit(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
-					_evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13);
+				sub_44892E_set_faces_bit(EVT_DWORD(_evt->v5),EVT_DWORD(_evt->v9), _evt->v13);
 				++curr_seq_num;
 				v4 = v124;
 				
@@ -1214,8 +1152,7 @@
 				//v7 = "";
 				break;
 			case EVENT_ToggleChestFlag:
-				Chest::ToggleFlag(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
-					_evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13);
+				Chest::ToggleFlag(EVT_DWORD(_evt->v5 ),	EVT_DWORD(_evt->v9 ), _evt->v13);
 				++curr_seq_num;
 				v4 = v124;
 				
@@ -1223,8 +1160,7 @@
 				//v7 = "";
 				break;
 			case EVENT_ToggleActorFlag:
-				Actor::ToggleFlag(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
-					_evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13);
+				Actor::ToggleFlag(EVT_DWORD(_evt->v5 ),	EVT_DWORD(_evt->v9 ), _evt->v13);
 				++curr_seq_num;
 				v4 = v124;
 				
@@ -1232,10 +1168,7 @@
 				//v7 = "";
 				break;
 			case EVENT_ToggleActorGroupFlag:
-				ToggleActorGroupFlag(
-					_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
-					_evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
-					_evt->v13);
+				ToggleActorGroupFlag(EVT_DWORD(_evt->v5 ),	EVT_DWORD(_evt->v9 ), _evt->v13);
 				++curr_seq_num;
 				v4 = v124;
 				
@@ -1252,30 +1185,18 @@
 				//v7 = "";
 				break;
 			case EVENT_StatusText:
-				v90 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
+				v90 = EVT_DWORD(_evt->v5 );
 				if ( activeLevelDecoration )
 					{
-					if ( activeLevelDecoration == (void*)1 )
+					if ( activeLevelDecoration == (LevelDecoration*)1 )
 						{
 						ptr_F8B1E8 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90];
-						++curr_seq_num;
-						v4 = v124;
-						
-						//v6 = v123;
-						//v7 = "";
-						break;
 						}
 					if ( canShowMessages == 1 )
 						{
 						v91 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90];
 						//LABEL_248:
 						ShowStatusBarString(v91, 2u);
-						++curr_seq_num;
-						v4 = v124;
-						
-						//v6 = v123;
-						//v7 = "";
-						break;
 						}
 					}
 				else
@@ -1284,12 +1205,6 @@
 						{
 						v91 = &pLevelStr[pLevelStrOffsets[v90]];
 						ShowStatusBarString(v91, 2u);
-						++curr_seq_num;
-						v4 = v124;
-						
-						//v6 = v123;
-						//v7 = "";
-						break;
 						}
 					}
 				++curr_seq_num;
@@ -1299,7 +1214,7 @@
 				//v7 = "";
 				break;
 			case EVENT_ShowMessage:
-				v92 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
+				v92 = EVT_DWORD(_evt->v5 );
 				if ( activeLevelDecoration )
 					{
 					v93 = (char *)pNPCTopics[v92-1].pText;//(&dword_721664)[8 * v92];
@@ -1317,20 +1232,15 @@
 				//v7 = "";
 				break;
 			case EVENT_CastSpell:
-				sub_448DF8_cast_spell(_evt->v5, _evt->v6, _evt->v7, _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8),
-					_evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8),
-					_evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8),
-					_evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8),
-					_evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8),
-					_evt->v28 + ((_evt->v29 + ((_evt->v30 + ((uint)_evt->v31 << 8)) << 8)) << 8));
+				sub_448DF8_cast_spell(_evt->v5, _evt->v6, _evt->v7, EVT_DWORD(_evt->v8 ),
+                    EVT_DWORD(_evt->v12 ), EVT_DWORD(_evt->v16 ), EVT_DWORD(_evt->v20 ),
+                    EVT_DWORD(_evt->v24 ), EVT_DWORD(_evt->v28 ));
 				++curr_seq_num;
 				v4 = v124;
-				
-				//v6 = v123;
-				//v7 = "";
+			
 				break;
 			case EVENT_SetTexture:
-				sub_44861E_set_texture(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), (char *)&_evt->v9);
+				sub_44861E_set_texture(EVT_DWORD(_evt->v5 ), (char *)&_evt->v9);
 				++curr_seq_num;
 				v4 = v124;
 				
@@ -1338,7 +1248,7 @@
 				//v7 = "";
 				break;
 			case EVENT_SetSprite:
-				SetDecorationSprite(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9, (char *)&_evt->v10);
+				SetDecorationSprite(EVT_DWORD(_evt->v5 ), _evt->v9, (char *)&_evt->v10);
 				++curr_seq_num;
 				v4 = v124;
 				
@@ -1346,12 +1256,9 @@
 				//v7 = "";
 				break;
 			case EVENT_SummonMonsters:
-				sub_448CF4_spawn_monsters(_evt->v5, _evt->v6, _evt->v7,
-					_evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8),
-					_evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8),
-					_evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8),
-					_evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8),
-					_evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8));
+				sub_448CF4_spawn_monsters(_evt->v5, _evt->v6, _evt->v7,EVT_DWORD(_evt->v8 ),
+                    EVT_DWORD(_evt->v12 ), EVT_DWORD(_evt->v16 ), EVT_DWORD(_evt->v20 ),
+                    EVT_DWORD(_evt->v24 ));
 				++curr_seq_num;
 				v4 = v124;
 				
@@ -1520,13 +1427,13 @@
 					pAudioPlayer->PlaySound(SOUND_EnteringAHouse, 814, 0, -1, 0, 0, 0, 0);
 					v104 = 187;
 					if ( uCurrentHouse_Animation != 167 )
-						v104 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
+						v104 = EVT_DWORD(_evt->v5);
 					window_SpeakInHouse = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, v104, 0);
 					window_SpeakInHouse->CreateButton( 61, 424, 31, 0, 2, 94, 0x6Eu, 1, 49, "", 0);
 					window_SpeakInHouse->CreateButton(177, 424, 31, 0, 2, 94, 0x6Eu, 2, 50, "", 0);
 					window_SpeakInHouse->CreateButton(292, 424, 31, 0, 2, 94, 0x6Eu, 3, 51, "", 0);
 					window_SpeakInHouse->CreateButton(407, 424, 31, 0, 2, 94, 0x6Eu, 4, 52, "", 0);
-					window_SpeakInHouse->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0);
+					window_SpeakInHouse->CreateButton(  0,   0,  0, 0, 1,  0, 0xB0u, 0, 9u, "", 0);
 					}
 				++curr_seq_num;
 				v4 = v124;