changeset 1420:e11c498c0dc6

more label cleaning 3
author zipi
date Sun, 28 Jul 2013 19:07:12 +0100
parents 9a1adf08f4ed
children 4fff79f04dbd
files CastSpellInfo.cpp Chest.cpp
diffstat 2 files changed, 18 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/CastSpellInfo.cpp	Sun Jul 28 18:54:40 2013 +0100
+++ b/CastSpellInfo.cpp	Sun Jul 28 19:07:12 2013 +0100
@@ -4070,29 +4070,25 @@
 unsigned int CastSpellInfo::PushCastSpellInfo(__int16 a2, __int16 uPlayerID, __int16 skill_level, __int16 a5, int spell_sound_id)
 {
   unsigned int result; // eax@1
-  CastSpellInfo *v7; // edx@1
   CastSpellInfo *v8; // ecx@5
 
   result = 0;
-  v7 = this;
-  while ( v7->spellnum )
+  for( result = 0; result < 10; result++ )
   {
-    ++result;
-    ++v7;
-    if ( (signed int)result >= 10 )
-      goto LABEL_8;
+	  if(!this[result].spellnum)
+	  {
+		  v8 = &this[result];
+		  v8->spellnum = a2;
+		  v8->uPlayerID = uPlayerID;
+		  if ( a5 & 0x10 )
+			v8->uPlayerID_2 = uPlayerID;
+		  v8->field_6 = 0;
+		  v8->spell_target_pid = 0;
+		  v8->field_8 = a5;
+		  v8->forced_spell_skill_level = skill_level;
+		  v8->sound_id = spell_sound_id;
+	  }
   }
-  v8 = &this[result];
-  v8->spellnum = a2;
-  v8->uPlayerID = uPlayerID;
-  if ( a5 & 0x10 )
-    v8->uPlayerID_2 = uPlayerID;
-  v8->field_6 = 0;
-  v8->spell_target_pid = 0;
-  v8->field_8 = a5;
-  v8->forced_spell_skill_level = skill_level;
-  v8->sound_id = spell_sound_id;
-LABEL_8:
   if ( result == 10 )
     result = -1;
   return result;
--- a/Chest.cpp	Sun Jul 28 18:54:40 2013 +0100
+++ b/Chest.cpp	Sun Jul 28 19:07:12 2013 +0100
@@ -419,18 +419,13 @@
     item_in_chest_count = CountChestItems(uChestID);
     if ( item_in_chest_count == -1 )
       return 0;
-    v22 = 0;
-    if ( v5 > 0 )
-    {
-      while ( !Chest::CanPlaceItemAt(v22, v4->uItemID, pChestWindow->par1C) )
+    for( int i = 0; i < v5; i++)
+	{
+      if ( Chest::CanPlaceItemAt(i, v4->uItemID, pChestWindow->par1C) )
       {
-        ++v22;
-        if ( v22 >= v5 )
-          goto LABEL_8;
+        v21 = i;
       }
-      v21 = v22;
     }
-LABEL_8:
     if ( v22 == v5 )
     {
       if ( uActiveCharacter )