Commit Graph

19909 Commits

Author SHA1 Message Date
Stan 1b8dcec53d Fix ptol temple's (from 7943d82bfe) rubble size and foundation size using the closest matching rubble and foundation. Rubble is currently not using correct units and is close to the size of the 5x9 foundation. The temple is a bit bigger than that one but we don't currently have anything bigger.
Reported by: @Nescio
This was SVN commit r22870.
2019-09-08 09:44:33 +00:00
LordGood 06fe767ffe fixed garrison flag on ptolemaic temple
This was SVN commit r22869.
2019-09-08 00:26:57 +00:00
elexis bfc34f3f58 Fix previous (invalid Freeze 508da732af).
This was SVN commit r22868.
2019-09-07 17:04:04 +00:00
elexis 508da732af Implement NetClient PushGuiMessage using parameter pack and ScriptInterface::CreateObject from D2080 / b4626359f5 to replace remaining Eval function calls.
Specialize ToJSVal<char[n]> to allow passing string literals as
arguments.
Freeze NetClient GUI messages.
Supersede related c-style casts with static casts.
Remove few unneeded conversions.

Differential Revision: https://code.wildfiregames.com/D2267
Tested: clang 8.0.1, Jenkins

This was SVN commit r22867.
2019-09-07 16:51:44 +00:00
wraitii f29159b935 Generalise attack tooltips after D2092/16b452cf91.
This allows attacks with both capture and damage effects to show both,
and centralises display between regular attack and Splash.
It also reverts a change from e05c8263c5 which incorrectly switched
'Interval' and 'Rate'.

Patch By: Freagarach
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D2138
This was SVN commit r22866.
2019-09-07 14:47:39 +00:00
wraitii 43bbd7d671 Check only that the destruction queue contains no non-local entity when serializing the game state.
Local entities being in the destruction queue when serialising is not an
issue since those should not affect the simulation anyways. This stops
the game from crashing in some rare situations.

Fixes #4616

Differential Revision: https://code.wildfiregames.com/D1738
This was SVN commit r22865.
2019-09-07 14:41:53 +00:00
wraitii 524422c7d8 Move "PlayersToDamage" from calling functions to "CauseDamageOverArea" and replace it with FriendlyFire.
Patch By: Freagarach
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D2064
This was SVN commit r22864.
2019-09-07 13:48:11 +00:00
elexis de050ef7e2 Remove some unused Profiler.h and CLogger.h includes.
NativeWrapperDefns.h from 4e87fef3da, found in audit of 7c21a0cf8e.

Differential Revision: https://code.wildfiregames.com/D2268
Tested on: clang 8.0.1, Jenkins

This was SVN commit r22863.
2019-09-07 13:35:45 +00:00
wraitii b1de59de66 Fix algorithmic error in 9903fd8a6c (waves computation speedup), and delete unused code.
9903fd8a6c introduced a much faster (for a little precision cost)
algorithm to compute distance to shore. However a condition was
incorrectly inverted, which made the algorithm return less-than-sensible
results in many situations.

Further, there was some unused code left behind which is now removed.

Fixes #5580

Reported by: nani (shore bug), elexis (unused code)
Differential Revision: https://code.wildfiregames.com/D2249
This was SVN commit r22862.
2019-09-07 08:50:55 +00:00
elexis 10f805fcf4 Fix wrong "player is not a moderator anymore" lobby chat message following initial implementation in 76bc9b579a/D339, fixes #4877.
It needs to test against the historic role and not the current role,
similar to 8b437a0b1c, refs #3386.
Implements the third GUI message property using the arbitrary lobby GUI
message patch in 9023f4bebb/D2264, refs #4482, 6bf74902a7/D2265.

Differential Revision: https://code.wildfiregames.com/D2266
Tested on: clang 8.0.1

This was SVN commit r22859.
2019-09-06 16:56:43 +00:00
elexis 9023f4bebb Support creating lobby GUI messages with arbitrary arguments instead of forcing every message type into the same struct type, refs #4877 / 76bc9b579a / D339.
Creates the GUI messages directly as JS::Values and removes the
intermediary rigid struct.
Implementation similar to ScriptInterface::CreateObject from D2080.

Differential Revision: https://code.wildfiregames.com/D2264
Tested on: clang 8.0.1, Jenkins

This was SVN commit r22856.
2019-09-06 05:14:20 +00:00
elexis 6bf74902a7 Drop lobby presence GUI messages altogether for better performance and less code complexity.
They were only used to determine whether the playerlist should be
rebuilt, which can be achieved by a boolean member.
So this patch is removing unnecessary indirection from the original
solution in 8b437a0b1c and the reduction in 16b976fc35, refs #3386.
In particular the LobbyClearPresenceUpdates call was ugly and one doesnt
need hundreds of messages with data on it each if one only wants to know
if there was one.
Makes past (e8dfde9ba6) and future (D2264) patches less complex, refs
#4877.

Differential Revision: https://code.wildfiregames.com/D2265
Tested on: gcc 9.1.0, clang 8.0.1, Jenkins

This was SVN commit r22855.
2019-09-06 02:53:22 +00:00
elexis adf448db4d Rewrite Main Menu.
Specify menu and submenu buttons title, tooltip, hotkey and actions
comfortably in an extensible JS object and derive the GUI object
settings based on that rather than relying on complex markup alternating
with JS in the same file.
Automatically compute the position and number of submenu items instead
of letting the author manually compute and keep that in sync in various
places of the XML file.

Use object oriented programming, so that there is a strong separation of
concerns, allowing the readers and authors to only involve themselves
with the component relevant to the feature they work on, refs #5387.
Use class keyword instead of prototype keyword for the JS classes,
because that enforces a policy where no globals are inserted between
class members and informs the reader of that as soon as reading the
classes first line, anticipating fragmentation.

Group project information and community links in a more clearly arranged
JS file.
Keep and document splashscreen onTick hack from a684f7646b, #2042,
#5578.
String change: Inform instead of warn (deter) about the state of the
game in the main menu.
Depends on Engine.SetGlobalHotkey from D2260.

Differential Revision: https://code.wildfiregames.com/D2240
Class syntax comments by: Krinkle, bb, Chakakhan, smiley, nani, fpre
Main menu comments by: Krinkle, nani, Stan (and Imarok in D820)
This was SVN commit r22854.
2019-09-06 01:20:46 +00:00
elexis afaa4417e4 Add ScriptInterface::AssignOrToJSVal<JS::Heap<JS::Value> > to support ScriptInterface::SetGlobal, SetProperty, CreateObject with JS::Heap values.
Differential Revision: https://code.wildfiregames.com/D2263
Tested on: gcc 9.1.0, Jenkins
Refs D2264

This was SVN commit r22853.
2019-09-05 16:45:16 +00:00
Alexandermb e7ebe821c0 Remove helmet during attack_slaughter animation.
Mentioned by @elexis in 65d2c26261

This was SVN commit r22852.
2019-09-05 10:57:37 +00:00
elexis f192d4a2fa Support assigning functions to hotkeys from the JS GUI without involving a GUI object.
Allows developers and modders to register and unregister hotkeys without
having to specify, change or overwrite XML files.
Also allows implementing the main menu GUI page with only GUI objects
for one submenu, refs #5387 / D2240.

Differential Revision: https://code.wildfiregames.com/D2260
Idea by nani in D2257.

This was SVN commit r22851.
2019-09-05 10:42:16 +00:00
Alexandermb eb87783f22 Correct shield_shieldsmall.dae > shieldsmall.dae
This was SVN commit r22849.
2019-09-05 00:29:52 +00:00
Stan 5109cda169 Improved mining animation.
Patch by: @Alexandermb
Thread:
https://wildfiregames.com/forum/index.php?/topic/26012-task-animations-re-export-and-unit-meshes-fix/page/16/

This was SVN commit r22848.
2019-09-04 21:00:31 +00:00
elexis d5c1fd09a4 Add ToJSVal<CRect> to make the conversion reusable, remove unused PSERROR_Scripting_ConversionFailed and dead catch.
Avoids the CRect copy or stops relying on optimization to avoid the
copy.
Split from D2142.

Differential Revision: https://code.wildfiregames.com/D2259
Tested on: gcc 9.1.0, Jenkins

This was SVN commit r22847.
2019-09-04 16:15:37 +00:00
elexis c25ab670e6 Don't crash if a JS GUI author calls Engine.PopGuiPage too often.
Differential Revision: https://code.wildfiregames.com/D2255
Tested On: clang 8.0.1, Jenkins
Comments By: Stan
This was SVN commit r22846.
2019-09-04 15:45:48 +00:00
elexis 33af6da5e1 Implement JS support for GUI object "hotkey" setting missing from 6d8b9e33ef, refs #567, #2604, 9e499cdec5.
Allows JS GUI to assign hotkeys to GUI objects from JS instead of XML.

Differential Revision: https://code.wildfiregames.com/D2257
Comments By: nani
Tested By: nani, Jenkins
Tested on: clang, VS2015

This was SVN commit r22845.
2019-09-04 15:29:36 +00:00
Alexandermb 0d47644b08 Replace idle because i can't upload the idle_relax_shieldsmall
This was SVN commit r22844.
2019-09-04 13:24:40 +00:00
Alexandermb fdd64b806c Some fixes to the infantry animations.
This was SVN commit r22843.
2019-09-04 13:13:29 +00:00
elexis f352d02caf Don't issue invalid move commands visualized with target markers in observermode following a1ddf6114a/D1021, refs #4791, #4302, e256d85305.
Differential Revision: https://code.wildfiregames.com/D2210
This was SVN commit r22842.
2019-09-04 12:55:16 +00:00
Stan cf45819cd2 Revert the quarry change from 4981cdedad and instead create a new template to accommodate the new quarry model.
Reported by: @elexis
This was SVN commit r22841.
2019-09-03 16:08:03 +00:00
Stan 3a31af7e92 Add description and demo keyword missing from 55b3086c03
Reported by: @elexis
This was SVN commit r22840.
2019-09-03 15:59:38 +00:00
Alexandermb 65d2c26261 Fix the issue with the formations and groups in actors And some corrections to variants.
This was SVN commit r22839.
2019-09-03 15:21:14 +00:00
Stan e008b394bc Fix the indent in ef53d85ee4
This was SVN commit r22838.
2019-09-03 09:48:23 +00:00
Stan ef53d85ee4 Rename the unusable 'roads/medit_city_tile.xml' to 'roads/medit_city_tile_02.xml' so that it can be used again. It was broken since its addition in 88ab3f0f5b. Make use of the normal and spec maps and rename them with the same convention.
Fixes #5558

This was SVN commit r22837.
2019-09-03 09:45:41 +00:00
elexis b7c59622ec Remove two GetTemplateDataHelper unused arguments following 1b20ac7671 and 6643613b54, refs #3934, #4801 / D1938.
Reported By: Polakrity
This was SVN commit r22836.
2019-09-03 09:42:37 +00:00
elexis ade8bcc0b8 Fix some Petra whitespace; with b59198524f/D2103 fixes all ESLint issues in petra/, refs #5524.
Differential Revision: https://code.wildfiregames.com/D1993
Patch By: Krinkle
This was SVN commit r22835.
2019-09-02 21:16:06 +00:00
elexis eb6f14a82d AI prototype chain cleanup.
Use prototype = Object.create(parent) instead of prototype = new
parent(...) to avoid calling the constructor needlessly (as it is
redundant with the base constructor call in the constructor calls the
parent constructor).

Testfile reference comes from 7c2e9027c2,
"initial terrible AI player scripts" had it since 57e5bb878a,
jubot copied it since 02ed11ac54,
qbot copied it since b146f53d7b
qbot-wc (later aegis) copied it since 45ee419171,
aegis copied it since bcf7115b5c,
petra copied it since 97afd25171.

d23b7deb98 used Object.create correctly for new code in aegis that was
adopted for petra too in 97afd25171.

Differential Revision: https://code.wildfiregames.com/D2238
Patch By: Krinkle
This was SVN commit r22834.
2019-09-02 17:33:59 +00:00
elexis 86fc1cf99c Gamesetup OOP cleanup, refs #5322.
Move updateAutocompleteEntries to g_MiscControls from b4e5858f6d/D322 to
remove a global variable, a global procedure, reduce updateGUIObjects
logic and increase logical grouping.
Rename autoCompleteNick to autoCompleteText since it's not only used for
nicknames following b4e5858f6d.

This was SVN commit r22831.
2019-09-02 02:13:11 +00:00
Gallaecio 749fbf7b5b legionnaire → legionary (4)
Differential Revision: D1780
This was SVN commit r22830.
2019-09-01 19:23:52 +00:00
elexis 283c7b58e2 Gamesetup cleanup, refs #5322.
Inline toggleReady from d1d7afe46c which became a oneline proxy to
setReady in 903803ceec used only in one place.
Inline senderFont and use setStringTags using 3cfb8730a8 from
Freagarachs patch in D2151.

This was SVN commit r22828.
2019-09-01 18:07:06 +00:00
elexis f04c6b68de Gamesetup OOP refactoring, refs #5322.
Move rightAlignCancelButton from 565709701e to g_MiscControls from D322
/ b4e5858f6d.
Move civResetButton from 78accf3d97 and teamResetButton from b134047abe
to g_MiscControls, refs #3805.
The constant string and constant function value assignment can be
reverted if performance is valued over code structuring.

This was SVN commit r22827.
2019-09-01 16:47:46 +00:00
elexis 398475b4ef Gamesetup OOP cleanup, refs #5322.
Move procedural updateGameDescription and getMapPreview to OOP
g_MiscControls from b4e5858f6d/D322.
Delete unused variable childSize following ac7b5ce861.
Remove host check in launchGame from 1c0536bf08 needless since
d1d7afe46c.

This was SVN commit r22826.
2019-09-01 15:35:10 +00:00
wraitii 67795d4451 Fix duplication and clang warning in unreachable gathering target fix 30dcd696eb / D2120
The function was put in an anonymous namespace to avoid linking errors
should another one be defined elsewhere.

Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D2243
This was SVN commit r22825.
2019-09-01 14:10:02 +00:00
wraitii 705266ceb2 Match unit classes with templates names
Remove Spear class from pikemen templates.
Give Macedonian Gastraphetes Crossbowman class, as it is a special unit.
Give Kushite Clubman the Clubman class, again a special unit.
Make FishingBoat a visible class.
Introduce Bireme, Trireme and Quinquereme visible classes.
Remove Melee class from Maurya Trireme.
Move Organic to template_unit as most units have it, remove it in
appropriate children templates.
List VisibleClasses directly after Classes.
Rename:
  - Axe -> Axeman
  - Javelin -> Javelinist
  - Pike -> Pikeman
  - Sling -> Slinger
  - Spear -> Spearman
  - Sword -> Swordsman
  - Catapult -> StoneThrower
Correct other simulation files accordingly.

Patch By: Nescio
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1815
This was SVN commit r22824.
2019-09-01 14:08:07 +00:00
Gallaecio 5fa75e845b legionnaire → legionary (3)
Differential Revision: D1780
This was SVN commit r22823.
2019-09-01 12:00:24 +00:00
elexis 0ecc005654 Remove nonexistent hotkey used in cccc55ce97, undefined until 50166bb456, unused since a964e83c79.
refs #wfg 2008-07-12

This was SVN commit r22822.
2019-09-01 11:22:43 +00:00
Gallaecio 9ced0a4e9c standardize resource tooltips
Differential Revision: D2006
This was SVN commit r22821.
2019-09-01 10:58:12 +00:00
Gallaecio 2e611665c0 standardize civ bonus technology tooltips
Differential Revision: D2187
This was SVN commit r22820.
2019-09-01 10:56:43 +00:00
Gallaecio a9df38d17e legionnaire → legionary (2)
Differential Revision: D1780
This was SVN commit r22819.
2019-09-01 10:53:42 +00:00
Gallaecio f27f481880 legionnaire → legionary
Differential Revision: D1780
This was SVN commit r22818.
2019-09-01 10:52:52 +00:00
wraitii 208fc30ddd Optimise MakeGoalReachable and FindNearestNavcellInRegions (D53 outtake)
By leveraging custom ordering in std::set, MakeGoalReachable and
FindNearestNavcellInRegions can be optimised and the code simplified.

Differential Revision: https://code.wildfiregames.com/D1882
This was SVN commit r22817.
2019-09-01 08:59:17 +00:00
wraitii 30dcd696eb Improve gathering behaviour when a target is not reachable
Units can be stuck in gather states when the target ought to be
collectable from, but it's actually unreachable.

A new FINDINGNEWTARGET intermediate state for GATHER will try and find a
new, different target to collect from. This should generally improve the
behaviour (perfect reachability checks would be required to completely
fix it).
Use this also when the target is knowably unreachable / uncollectible.

Fixes #5529

Differential Revision: https://code.wildfiregames.com/D2120
This was SVN commit r22816.
2019-09-01 07:35:32 +00:00
wraitii 9e41ff39fc Unit Motion - make sure units don't get stuck in the special long-path computation step.
In some rare cases, units could be stuck in the special state of 3
failed path computations, making them always compute long paths instead
of trying short paths again. This can happen when they compute a long
path successfully, but the unit cannot actually move as it gets
obstructed right away.
Make sure this state is never kept for more than one turn to fix this
problem.

Refs #5569 (probable fix but kept open for further investigating).

Differential Revision: https://code.wildfiregames.com/D2239
This was SVN commit r22815.
2019-09-01 07:31:21 +00:00
wraitii 2c229a986d Further fixes for Generalized Attack D2092/16b452cf91
Iterating over attack effects incorrectly returned instead of continuing
when the target did not have a receiver.
Polar Sea triggers used Attack instead of Attacking.

Reported By: Freagarach
Differential Revision: https://code.wildfiregames.com/D2235
This was SVN commit r22814.
2019-09-01 07:28:50 +00:00
wraitii dd86d599f5 Fix modifiers affecting player entity following ModifiersManager component in e16c4c4800
Modifiers affecting the player entity itself were not applying
correctly.
The reason was that the cache was not correctly reset.
Adds a regression test.



Reported By: Minohaka
Tested By: Minohaka
Refs #5572 (probably fixed but kept open for verifiation).

Differential Revision: https://code.wildfiregames.com/D2236
This was SVN commit r22813.
2019-09-01 07:16:02 +00:00