Page MenuHomeWildfire Games

Do not allow upgrading when entity is producing and vice versa.
Changes PlannedPublic

Authored by Angen on Mar 15 2020, 12:51 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Trac Tickets
#2706
#5749
Summary

See rP23185, rP23239 and ticket 2706

elexis

I'm not sure if it even makes sense to allow researching techs while upgrading, since the upgraded structure might not provide that technology.

Nescio

Entities shouldn't be able to train or research anything while (un)packing or being upgraded.

Messages are displayed to player when action cannot be done.
Petra does not upgrade entities, so do not care in this diff about her to not be able to start production.

Test Plan

Test that producing entity cannot be upgraded.
Test that upgrading entity cannot start production.
Test that with multiple selection entities not producing can start upgrading and vice versa.

Unit TestsFailed

TimeTest
0 msJenkins > TestComponentScripts::test_scripts
Test failed: L"Running script simulation/components/tests/test_ProductionQueue.js" Assertion failed: scriptInterface.LoadScript(pathname, content) Test failed: L"Running script simulation/components/tests/test_UpgradeModification.js"
0 msJenkins > cxxtest-debug-gcc6.xml::[failed-to-read]
Failed to read test report file /zpool0/trunk/cxxtest-debug-gcc6.xml org.dom4j.DocumentException: Error on line 1 of document : Content is not allowed in prolog. at org.dom4j.io.SAXReader.read(SAXReader.java:462)
0 msJenkins > cxxtest-debug.xml::[failed-to-read]
Failed to read test report file /Users/wfg/Jenkins/workspace/macos-differential/cxxtest-debug.xml org.dom4j.DocumentException: Error on line 1 of document : Content is not allowed in prolog. at org.dom4j.io.SAXReader.read(SAXReader.java:462)
0 msJenkins > TestAllocators::test_da
0 msJenkins > TestAtlasObjectXML::test_parse_attributes1
View Full Test Results (3 Failed · 339 Passed)

Event Timeline

Angen created this revision.Mar 15 2020, 12:51 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1856/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/433/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1337/display/redirect

Stan added a reviewer: Restricted Owners Package.Mar 18 2020, 12:13 PM
Stan added a subscriber: Stan.Mar 18 2020, 12:15 PM
Stan added inline comments.
binaries/data/mods/public/simulation/components/ProductionQueue.js
265

Does upgrade cancel the queue?

890

this.queue.length? since it shouldn't be negative anyway?

binaries/data/mods/public/simulation/components/Upgrade.js
232

Ah I see. Maybe it could cancel, or show a popup to cancel. then show the warning ?

Should we disable the button when it cannot be used?

Angen planned changes to this revision.Mar 20 2020, 6:26 PM

Need to fix tests.

I was thinking about it, but I am not sure how it would work with multiple entities selected. It would need to be disabled only when all selected entities that would be selected would not be able to produce/upgrade. In general its good idea, but I need to check performance for checking every selected entity.

Angen added inline comments.Apr 9 2020, 11:45 AM
binaries/data/mods/public/simulation/components/ProductionQueue.js
890

then it does not return true / false what was pointed at another diff with similar line

Stan added inline comments.Apr 9 2020, 12:04 PM
binaries/data/mods/public/simulation/components/ProductionQueue.js
890

Oh right.

Test is simple, just load the intefaces ^^
It is probably not possible when two (or more) entities are selected and one of them is upgrading that the rest can continue receiving producing orders?

elexis updated the Trac tickets for this revision.Sat, May 9, 11:48 PM