Commit Graph

19886 Commits

Author SHA1 Message Date
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
Alexandermb a8afe55b02 Following 4c2b3b6fda Mesh wasn't committed.
This was SVN commit r22812.
2019-08-31 19:40:35 +00:00
Alexandermb 4c2b3b6fda Rome Infantry Spearman helmet (Apulo Corinthian)
Update of Apulo-Corinthian Type helmets replacing the ones i've did
before with a better quality ones.

Thread:
https://wildfiregames.com/forum/index.php?/topic/24494-task-roma-helmets/&do=getNewComment

This was SVN commit r22811.
2019-08-31 19:38:03 +00:00
wraitii 055935fa0e Remove Mechanical class in favour or using Siege and Ship.
Mechanical was a union of Siege and Ship and not very used.
The '_mechanical' part of template names was removed in d3a73f0611.

Replace its usage with Ship and/or Siege where relevant.

Reviewed By: wraitii
Patch By: Nescio
Differential Revision: https://code.wildfiregames.com/D2201
This was SVN commit r22810.
2019-08-31 12:44:48 +00:00
wraitii 74ac1111b6 Change CitizenSoldier class to Citizen and/or Soldier in auras and technologies.
Usage of these classes was inconsistent, and CitizenSoldier is a
non-visible class so should not be used in data files.

Reviewed By: wraitii
Patch By: Nescio
Differential Revision: https://code.wildfiregames.com/D2200
This was SVN commit r22809.
2019-08-31 12:41:43 +00:00
wraitii 381bdcbade Fix cc1ea7cca0 error in Promotion when promoting an entity that died on the same turn.
Add a regression test for this case.

Reported By: elexis
Differential Revision: https://code.wildfiregames.com/D2227
This was SVN commit r22808.
2019-08-31 12:38:38 +00:00
elexis 395fae107b Fix missing PushGuiPage callback replacement in session/ openManual() in 86c151ebaa, refs D1684.
This was SVN commit r22807.
2019-08-31 11:00:26 +00:00
LordGood 7943d82bfe Cypresses, maritime pines, emergent teak variant, grasses ptolemaic tower, walls and temple commit, ptolemaic texture split
This was SVN commit r22804.
2019-08-30 00:19:16 +00:00
elexis b59198524f Remove PETRA Module and Augmentation pattern from 3362c591f5, refs #2322, and in Petra since 97afd25171.
The objective of 3362c591f5 to have only one global for multiple AIs is
still achieved by not changing the resulting object structure.
The advantage of not using the pattern is to have less parental scopes,
i.e. more localization and separation of concerns.
This resembles the successful simulation script component system.
The stated benefits of the Augmentation pattern were never used, because
there are (luckily) no such private variables or globals passed as
arguments.

Fixes an ESLint warning about using PETRA before it is defined, refs
#5524, D1993.
Fixes the missing level of indentation if indentation should represent
scoping proportionally.

Remove superfluous, thus misleading name PetraBot in PETRA.PetraBot
assignment.

Differential Revision: https://code.wildfiregames.com/D2103
Patch By: Krinkle
Related comments by: Yves, wraitii, Philip, leper on #0ad-dev on
December 2013, see #2322
Source was:
http://www.adequatelygood.com/JavaScript-Module-Pattern-In-Depth.html

This was SVN commit r22803.
2019-08-29 18:12:53 +00:00
Stan bc9116cdfb Use the @wowgetoffyourcellphone's Uffington Horse as the Briton Wonder committed in @Enrique's special commit 83680b0dee. As such the building is no longer garrisonable, and no longer gives a population bonus.
Discussed with: @wowgetoffyourcellphone
Thread 1:
https://wildfiregames.com/forum/index.php?/topic/20986-civ-britons/&tab=comments#comment-318536
Thread 2:
https://wildfiregames.com/forum/index.php?/topic/17495-task-wonder-britons-stonehenge-and-white-horse/page/6/&tab=comments#comment-298890

This was SVN commit r22802.
2019-08-29 15:55:12 +00:00
elexis 9c6039e4fe Solemnly delete class GUI and rename GUIUtil.h to CGUISetting.h.
Finishes GUIutil rewrite and fixes #5575.

Differential Revision: https://code.wildfiregames.com/D2233
Test on: clang 8.0.1, Jenkins

This was SVN commit r22801.
2019-08-29 09:07:29 +00:00
elexis 0c3a610acc Delete invalid ModmodScrollbar style use and style property from 64bfa089af and 833c9f108c, identified by the LOGWARNING from be963ec9b7, reported by nani.
This was SVN commit r22800.
2019-08-29 07:56:26 +00:00
Alexandermb 18c90ce449 Fix female axe position while gathering wood.
Reported by @wowgetoffyourcelphone

This was SVN commit r22798.
2019-08-28 17:51:49 +00:00
elexis fac98e7afb Move other/wallset_palisade to structures/wallset_palisade, refs #4770, D1002, D1798.
Differential Revision: https://code.wildfiregames.com/D1881
Patch By: Nescio
While at it, fix ESLint overshadowing warning in survival triggers from
804fd4be61, unnoticed in b8fbfe2d20 and 18e7d8a518 but noticed by
Jenkins.

This was SVN commit r22797.
2019-08-28 12:06:59 +00:00
elexis 1a49ccb294 Move static GUI<>::SetSetting operating on IGUIObject to a member IGUIObject::SetSetting.
Remove PSERROR codes from SetSetting (let std::map throw an out_of_range
if a caller wants to Set a setting that doesn't exist without having
checked with SettingExists, equal to GetSetting from 92b6cdfeab).
That also simplifies std::function SetSettingWrap construct from
0a7d0ecdde to void IGUIObject::SettingChanged.
Don't trigger debug_warn or exceptions in GUITooltip::ShowTooltip if the
XML author specified wrong tooltip input, and dodge another
dynamic_cast.

Rename existing IGUIObject::SetSetting to
IGUIObject::SetSettingFromString and comment that it is purposed for
parsing XML files.
Remove SetSetting default value, so that authors are made aware
explicitly of the need to decide the function broadcasting a message,
refs d87057b1c0, 719f2d7967, ...
Change const bool& SkipMessage to const bool SendMessage, so that a
positive value relates to a positive action.
Clean AddSettings whitespace and integer types.

Differential Revision: https://code.wildfiregames.com/D2231
Tested on: gcc 9.1.0, clang 8.0.1, Jenkins
Comments By: Philip on IRC on 2010-07-24 on GUIUtil being ugly, in case
that one counts

This was SVN commit r22796.
2019-08-28 11:21:11 +00:00
Alexandermb 36e2c1caf8 Remove now unused rome_helmet_attic.xml due to better version (both done by myself)
This was SVN commit r22794.
2019-08-27 23:31:10 +00:00
wackyserious a5679ddcd4 Texture Update: Seleucid Pikeman and Cataphract
Thread:
https://wildfiregames.com/forum/index.php?/topic/26907-task-compounded-linothorax-unit-texture/&tab=comments#comment-383735

General Discussion:
https://wildfiregames.com/forum/index.php?/topic/22184-task-greek-unit-texture-general-thread/page/9/#comments

Reviewed by: Lordgood, Alexandermb and wowgetoffyourcellphone
This was SVN commit r22793.
2019-08-27 21:21:07 +00:00
elexis be963ec9b7 Delete 27 invalid style settings and add LOGWARNING to inform future authors.
Unify the two IGUIObject::LoadStyle functions and remove CGUI argument
that is always identical to the member.

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

This was SVN commit r22792.
2019-08-27 16:03:24 +00:00
elexis 0a6b650189 Delete SGUIMessage GUIM_SETTINGS_UPDATED broadcasts redundant with the broadcast initiated from SetSetting from e21ebb37f5.
659a9ea57a introduced the call rightfully in ShowTooltip since
CTooltip::SetupText() depends on the just changed _mousepos setting.
But then 0382cdd9b1 moved that _mousepos SetSetting call, resulting in
the message becoming redundant; and it inserted the second redundant
message in HideTooltip.

These were the only redundant SGUIMessage HandleMessage calls.

This was SVN commit r22790.
2019-08-26 23:39:16 +00:00
elexis 92b6cdfeab Move static GUI<>::GetSetting operating on IGUIObject member to a IGUIObject member function, grouping it with SettingExists and AddSetting.
Differential Revision: https://code.wildfiregames.com/D2230
Tested on: gcc 9.1.0, Jenkins

This was SVN commit r22789.
2019-08-26 12:25:07 +00:00
wraitii 85d01b839c Fix attack/armor techs not applying after 16b452cf91, and fix auras/techs affecting capture rate.
Reported By: Nescio
Patch By: Freagarach
Differential Revision: https://code.wildfiregames.com/D2224
This was SVN commit r22786.
2019-08-25 18:03:32 +00:00
elexis 719f2d7967 Remove default CGame constructor values to make the code less error-prone, use CRenderer::IsInitialised() to test if the CGame should be rendered to remove indirection/proxies, making the code easier to read.
1c0536bf08 introduced a disableGraphics bool with a default value and
relied on the default being reasonable except for the few needed cases.
be93b31411 introduced the replayLog argument with a default value and
relied on the default being reasonable except for the few needed cases.
5747619c39 fixed a bug in that commit because the default value hadn't
actually been considered to be correct for all CGame constructor calls
and was wrong for two.

By requiring callers to specify the value, authors are forced to
establish thought which value is the correct one, as opposed to hoping
that a default value will be good by default.
As you can see in the diff, it also makes it easier to compare what
values changed if they are always defined in the caller.

Use CRenderer::IsInitialised() to determine if this is a non-visual
CGame,
for the purpose of removing less transparent proxy functions that are
unneeded as long as there are about 30 other calls testing for
CRenderer::IsInitialised() to determine if the Game should be rendered.

Supersedes:
* CGame constructor argument bool disableGraphics from 1c0536bf08.
* CGame::IsGraphicsDisabled() proxy from a533fff883 to the proxy from
1c0536bf08 and two local nonVisual = args.Has("autostart-nonvisual")
variables in GameSetup.cpp from a533fff883.

Call the Renderer destructor instead of calling delete on the
non-pointer (SAFE_DELETE would not be supported for instance).

Started as a preparation for D2197, but actually independent.

Differential Revision: https://code.wildfiregames.com/D2211
This was SVN commit r22785.
2019-08-25 11:02:55 +00:00
Gallaecio 336c423e8e standardized structure aura descriptions
Patch By: Nescio
Differential Revision: D1806
This was SVN commit r22784.
2019-08-25 09:20:43 +00:00
Gallaecio 27a190578f correct descriptions and tooltips of siege technologies
Patch By: Nescio
Differential Revision: D2186
This was SVN commit r22783.
2019-08-25 09:19:01 +00:00