Page MenuHomeWildfire Games

Fix attack notification (rP24565)
ClosedPublic

Authored by Imarok on Jan 16 2021, 6:23 PM.

Details

Summary

It can happen that the attacked unit is already dead when the gui gets the notification. In that case it fails to get its position.
As a fix the location is already determined in the simulation and send along with the notification to the gui.
(This also looks way cleaner in general)

Test Plan

Test if you can reproduce the issue described in rP24565. (E.g. use the notification at 14:20 of the replay on D3373)

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Imarok created this revision.Jan 16 2021, 6:23 PM

Build has FAILED

builderr-debug-macos.txt
fatal error: fatal errorfatal error: : file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/js/Result.h' has been modified since the precompiled header 'obj/simulation2_Debug/precompiled.h.gch' was builtfile '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/js/Result.h' has been modified since the precompiled header 'obj/simulation2_Debug/precompiled.h.gch' was built

file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/js/Result.h' has been modified since the precompiled header 'obj/simulation2_Debug/precompiled.h.gch' was built
note: fatal errornotenote: : please rebuild precompiled header 'obj/simulation2_Debug/precompiled.h.gch': 
file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/2902/display/redirect
See console output for more information: https://jenkins.wildfiregames.com/job/macos-differential/2902/display/redirectconsole

Imarok edited the summary of this revision. (Show Details)Jan 16 2021, 6:26 PM
Imarok added a subscriber: Freagarach.
Imarok requested review of this revision.Jan 16 2021, 7:54 PM

Probably a insta-kill attack would do the job of reproducing.

binaries/data/mods/public/gui/session/messages.js
201 ↗(On Diff #15394)

Ah, yes, I did mean that xD I was so confused when reading my comment on the commit ^^'

Freagarach accepted this revision.Jan 17 2021, 6:56 AM
  • Fixes the described issue
  • Getting the position there is indeed cleaner, but also more performant probably (no need to get the entity state in the message).
This revision is now accepted and ready to land.Jan 17 2021, 6:56 AM
wraitii added inline comments.
binaries/data/mods/public/simulation/components/AttackDetection.js
128 ↗(On Diff #15394)

could use event.position to avoid re-querying.

Silier resigned from this revision.Jan 17 2021, 5:00 PM
Imarok updated this revision to Diff 15581.Jan 20 2021, 9:43 PM

Reuse event.position as event is used widely anyway.

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
../../../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& password)
                                                                      ^
1 warning generated.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libengine_dbg.a(precompiled.o) has no symbols
ld: warning: text-based stub file /System/Library/Frameworks//CoreAudio.framework/Core

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

This revision was landed with ongoing or failed builds.Jan 20 2021, 10:00 PM
This revision was automatically updated to reflect the committed changes.