Page MenuHomeWildfire Games

Do not go to the nearest dropsite when full and asked to hunt/slaughter
Needs ReviewPublic

Authored by Stan on Jan 21 2021, 12:27 PM.

Details

Reviewers
Freagarach
wraitii
Trac Tickets
#5954
Summary

As reported by @Feldfeld after D2791, units asked to hunt will go to nearest dropsite when full instead of attacking.

In theory this is not an issue, but one might want to kill other targets before getting the cavalry home, so that other units can gather.

This patch moves the dropsite check after the hunting check to restore the original behavior

Test Plan

Ask a cavalry unit to hunt, and when it's full ask it to hunt another one, notice it doesn't go back to the dropsite anymore

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
SeverityLocationCodeMessage
Warningbinaries/data/mods/public/simulation/components/UnitAI.js:342ESLintBear (consistent-return)ESLintBear (consistent-return)
Warningbinaries/data/mods/public/simulation/components/UnitAI.js:785ESLintBear (no-else-return)ESLintBear (no-else-return)
Warningbinaries/data/mods/public/simulation/components/UnitAI.js:2154ESLintBear (operator-linebreak)ESLintBear (operator-linebreak)
Unit
No Unit Test Coverage
Build Status
Buildable 15323
Build 33388: Vulcan BuildJenkins
Build 33387: Vulcan Build (macOS)Jenkins
Build 33386: Vulcan Build (Windows)Jenkins
Build 33385: arc lint + arc unit

Event Timeline

Stan created this revision.Jan 21 2021, 12:27 PM

Build is green

builderr-debug-macos.txt
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libnetwork_dbg.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/liblobby_dbg.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libsimulation2_dbg.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libscriptinterface_dbg.a(precompiled.o) has no symbols
../../../source/network/scripting/JSInterface_Network.cpp:169:71: warning: unused parameter 'pCmptPrivate' [-Wunused-parameter]
void JSI_Network::StartNetworkJoinLobby(ScriptInterface::CmptPrivate* pCmptPrivate, const CStrW& playerName, const CStr& hostJID, const CStr& pas

See https://jenkins.wildfiregames.com/job/macos-differential/3004/display/redirect for more details.

Stan requested review of this revision.Jan 21 2021, 1:04 PM
wraitii requested changes to this revision.Jan 21 2021, 1:20 PM
wraitii added a subscriber: wraitii.
wraitii added inline comments.
binaries/data/mods/public/simulation/components/UnitAI.js
548–568

Should be here no?

This revision now requires changes to proceed.Jan 21 2021, 1:20 PM
Stan updated this revision to Diff 15602.Jan 21 2021, 1:39 PM

AM DUMB

Build is green

builderr-debug-macos.txt
ld: warning: text-based stub file /System/Library/Frameworks//CoreAudio.framework/CoreAudio.tbd and library file /System/Library/Frameworks//CoreAudio.framework/CoreAudio are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox.tbd and library file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//ForceFeedback.framework/ForceFeedback.tbd and library file /System/Library/Frameworks//ForceFeedback.framework/ForceFeedback are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreVideo.framework/CoreVideo.tbd and library file /System/Library/Frameworks//CoreVideo.framework/CoreVideo are out of sync. Falling back to library file for linking.
ld: warning: text-based stu

See https://jenkins.wildfiregames.com/job/macos-differential/3006/display/redirect for more details.

I think this is a good call, so long as the entities aren't spoiling. If we start having entities that spoil, it probably makes more sense to change this back.

I dunno if that's really something we plan. If not, I'd change this back for consistency with A23, if yes, I think we can leave as-is for now.

Stan added a comment.Jan 21 2021, 3:22 PM

What do you mean by spoil? D1718?
This patch is for A25 anyway no?

In D3444#152427, @Stan wrote:

What do you mean by spoil? D1718?
This patch is for A25 anyway no?

Yeah, but my point is that if entities will "decay" when killed, it doesn't seem particularly useful to fix this now when we'll just have to remember to revert it in A25 (which we might forget)

Stan added a comment.Jan 21 2021, 4:46 PM

I mean this patch is for A25. According to @Freagarach at least. So we can see then.

(See D3226 where I basically do the same.)