Opened 3 years ago

Closed 3 years ago

#6328 closed defect (fixed)

Negative amount of resource gatherers

Reported by: Langbart Owned by: Freagarach
Priority: Should Have Milestone: Alpha 26
Component: UI – In-game Keywords:
Cc: Patch: Phab:D4274

Description (last modified by Langbart)

While playing the latest SVN version, the amount of resource gatherers in the top panel displayed a negative number.

In the attached replay, the issue can be observed for the blue Player around the 3min:10sec mark. Attached replay: negative_resourceGatherers.zip

The cause of the problem might be related to my experiments with the cheat code wololo (see wiki/Manual_Cheats). I turned a few units of the red player into my people. But I remember that I also saw a negative number in Delenda Est because slaves can be captured there.

EDIT: When I change the ownership (via cheat code) of one of my enemy units to mine, the status of the unitAI changes. It subtracts a food gatherer from me (Player 1), but the number for my enemy (Player 2) does not change. I assume the issues sits in ResourceGatherer.js or UnitAI.js.

Issue is reproducible for A24b.

Attachments (4)

negative_resourceGatherers.jpg (15.6 KB ) - added by Langbart 3 years ago.
negative_resourceGatherers.zip (10.7 KB ) - added by Langbart 3 years ago.
after_wololo_cheat_code.png (404.2 KB ) - added by Langbart 3 years ago.
before_wololo_cheat_code.png (477.7 KB ) - added by Langbart 3 years ago.

Download all attachments as: .zip

Change History (10)

by Langbart, 3 years ago

by Langbart, 3 years ago

comment:1 by Langbart, 3 years ago

Description: modified (diff)

by Langbart, 3 years ago

Attachment: after_wololo_cheat_code.png added

by Langbart, 3 years ago

comment:2 by Langbart, 3 years ago

Description: modified (diff)

Issue is reproducible for A24b.

comment:3 by Freagarach, 3 years ago

As far as I know this has been the case since its inclusion in r24357, but I see on the patch Phab:D3155 that I haven't noted it down.

comment:4 by Freagarach, 3 years ago

(The problem is we want to change to IDLE before the ownership change actually happens, but that might put us in another state again (e.g. enemies in range).) I might be able to figure something to fix this.

comment:5 by Freagarach, 3 years ago

Owner: set to Freagarach
Patch: Phab:D4274

It actually was easier than I thought.

comment:6 by Freagarach, 3 years ago

Resolution: fixed
Status: newclosed

In 25941:

Fix negative number of gatherers upon ownership changes.

Differential revision: https://code.wildfiregames.com/D4274
Reviewed by: @bb
Comments by: @Langbart, @Stan, @wraitii
Fixes: #6328

Note: See TracTickets for help on using tickets.