Fix fencepost error in giftArtifact() properly. Now we do not skip research item zero,
and we do not underflow an unsigned value. Patch by Adam Olsen (Rhamphoryncus). Closes ticket:373 git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8082 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
2cabd14a50
commit
ef9e770ab3
|
@ -730,15 +730,14 @@ void recvMultiPlayerRandomArtifacts()
|
|||
// ///////////////////////////////////////////////////////////////
|
||||
void giftArtifact(UDWORD owner, UDWORD x, UDWORD y)
|
||||
{
|
||||
PLAYER_RESEARCH *pO,*pR;
|
||||
UDWORD topic=0;
|
||||
pR = asPlayerResList[selectedPlayer];
|
||||
PLAYER_RESEARCH *pR = asPlayerResList[selectedPlayer];
|
||||
|
||||
if (owner < MAX_PLAYERS)
|
||||
{
|
||||
pO = asPlayerResList[owner];
|
||||
PLAYER_RESEARCH *pO = asPlayerResList[owner];
|
||||
int topic;
|
||||
|
||||
for (topic = numResearch - 1; topic > 0; topic--)
|
||||
for (topic = numResearch - 1; topic >= 0; topic--)
|
||||
{
|
||||
if (IsResearchCompleted(&pO[topic])
|
||||
&& !IsResearchPossible(&pR[topic]))
|
||||
|
|
Loading…
Reference in New Issue