mail[Wesnoth-commits] r28952 - /trunk/src/actions.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by patrick_X99 on August 25, 2008 - 02:36:
Author: sapient
Date: Mon Aug 25 02:36:49 2008
New Revision: 28952

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28952&view=rev
Log:
remove an unnecessary check in my last commit

Modified:
    trunk/src/actions.cpp

Modified: trunk/src/actions.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/actions.cpp?rev=28952&r1=28951&r2=28952&view=diff
==============================================================================
--- trunk/src/actions.cpp (original)
+++ trunk/src/actions.cpp Mon Aug 25 02:36:49 2008
@@ -817,16 +817,13 @@
                        //the currently selected attack fits
                        return;
                }
-               if(weap_id.empty() && (weap_index < 0 || weap_index > 
attacks.size())) {
-                       //don't attempt to lookup an empty id
-                       weap_index = -1;
-                       return;
-               }
-               //lookup the weapon by id
-               for(int i=0; i<attacks.size(); ++i) {
-                       if(attacks[i].id() == weap_id) {
-                               weap_index = i;
-                               return;
+               if(!weap_id.empty()) {
+                       //lookup the weapon by id
+                       for(int i=0; i<attacks.size(); ++i) {
+                               if(attacks[i].id() == weap_id) {
+                                       weap_index = i;
+                                       return;
+                               }
                        }
                }
                //lookup has failed




Related Messages


Powered by MHonArc, Updated Mon Aug 25 03:22:47 2008