Skip to content

Commit

Permalink
Fix off-by-one bug in transporter capacity count.
Browse files Browse the repository at this point in the history
Closes ticket:4394
  • Loading branch information
perim committed May 15, 2016
1 parent 0556c63 commit 5e45761
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/transporter.cpp
Expand Up @@ -1076,11 +1076,11 @@ bool checkTransporterSpace(DROID const *psTransporter, DROID const *psAssigned,
}

/*returns the space the droid occupies on a transporter based on the body size*/
UDWORD transporterSpaceRequired(DROID const *psDroid)
int transporterSpaceRequired(const DROID *psDroid)
{
// all droids are the same weight for campaign games.
// TODO - move this into a droid flag
return bMultiPlayer ? (asBodyStats + psDroid->asBits[COMP_BODY])->size : 1;
return bMultiPlayer ? (asBodyStats + psDroid->asBits[COMP_BODY])->size + 1 : 1;
}

/*sets which list of droids to use for the transporter interface*/
Expand Down
2 changes: 1 addition & 1 deletion src/transporter.h
Expand Up @@ -36,7 +36,7 @@
#define TRANSPORTER_CAPACITY 10

/// how much cargo capacity a droid takes up
UDWORD transporterSpaceRequired(DROID const *psDroid);
int transporterSpaceRequired(const DROID *psDroid);

//initialises Transporter variables
extern void initTransporters(void);
Expand Down

0 comments on commit 5e45761

Please sign in to comment.