Skip to content

Commit

Permalink
fixed an array bounds error with the CrewUnitGroup example class that…
Browse files Browse the repository at this point in the history
… kept one cargo seat empty sometimes
  • Loading branch information
dwringer committed Oct 29, 2016
1 parent 9305bc9 commit 37f7c32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ClassDemo.Tanoa/classdef/CrewUnitGroup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ DEFMETHOD("CrewUnitGroup", "board_instant") ["_self"] DO {
};
for "_i" from 0 to (_vlen - 1) do {
if ((count _cargoSeats) > _i) then {
for "_j" from 0 to (_cargoSeats select _i) do {
for "_j" from 0 to ((_cargoSeats select _i) - 1) do {
if ((count _gunners) > 0) then {
_vehicle = _vehicles select _i;
_cargo = _gunners select 0;
Expand All @@ -131,4 +131,4 @@ DEFMETHOD("CrewUnitGroup", "board_instant") ["_self"] DO {
};
};
};
} ENDMETHOD;
} ENDMETHOD;
4 changes: 2 additions & 2 deletions classdef/CrewUnitGroup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ DEFMETHOD("CrewUnitGroup", "board_instant") ["_self"] DO {
};
for "_i" from 0 to (_vlen - 1) do {
if ((count _cargoSeats) > _i) then {
for "_j" from 0 to (_cargoSeats select _i) do {
for "_j" from 0 to ((_cargoSeats select _i) - 1) do {
if ((count _gunners) > 0) then {
_vehicle = _vehicles select _i;
_cargo = _gunners select 0;
Expand All @@ -131,4 +131,4 @@ DEFMETHOD("CrewUnitGroup", "board_instant") ["_self"] DO {
};
};
};
} ENDMETHOD;
} ENDMETHOD;

0 comments on commit 37f7c32

Please sign in to comment.