File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -378,8 +378,7 @@ void CraftEquipmentState::moveLeft(int change)
378378 {
379379 _base->getItems ()->addItem (ammo->getType (), (*i)->getAmmo ());
380380 delete (*i);
381- c->getVehicles ()->erase (i);
382- i = c->getVehicles ()->begin (); // Since we erased the current iterator, we have to start over (to avoid a crash)
381+ i = c->getVehicles ()->erase (i);
383382 }
384383 else ++i;
385384 }
@@ -395,9 +394,8 @@ void CraftEquipmentState::moveLeft(int change)
395394 if ((*i)->getRules () == item)
396395 {
397396 delete (*i);
398- c->getVehicles ()->erase (i);
397+ i = c->getVehicles ()->erase (i);
399398 if (0 >= --change) break ;
400- i = c->getVehicles ()->begin (); // Since we erased the current iterator, we have to start over (to avoid a crash)
401399 }
402400 else ++i;
403401 }
Original file line number Diff line number Diff line change 2525#include " Exception.h"
2626#include " ShaderMove.h"
2727#include < stdlib.h>
28- #include < malloc.h>
2928
3029#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
3130#define _aligned_malloc __mingw_aligned_malloc
You can’t perform that action at this time.
0 commit comments