Commit Graph

13675 Commits

Author SHA1 Message Date
5c07a25ddc More exact stack rooting (CallFunction object).
Changes CallFunction and CallFunctionVoid to use a HandleValue as object
parameter. Also changes some JS serialization/deserialization functions
to only support the JSAPI rooted types (drop support for CScriptVal and
CScriptValRooted there). Some other functions got changed too because
they were closely related.

Refs #2415
Refs #2462

This was SVN commit r15592.
2014-07-31 19:18:40 +00:00
d677a30c39 Adds support for passing JS::HandleValue and JS::RootedValue& to CallFunction.
Also adds tests for these cases.

Refs #2415

This was SVN commit r15591.
2014-07-31 16:34:15 +00:00
af8b76e227 Avoids dividing by zero when generating Gulf of Bothnia random map with one player. Patch by FeXoR, fixes #2699.
This was SVN commit r15590.
2014-07-31 16:03:35 +00:00
2ae74221c7 Fixes saving/loading problems introduced in 28bdd8540f.
* CGameLoader created a new JS::Value when assigning to m_Metadata.
This means it didn't actually update metadata in SavedGames::Load. The
new approach solves this problem and should work well if
CScriptValRooted gets replaced in the future.
 * The cloning in ScriptFunctions.cpp was required. Removing it caused
compartment mismatches.
 * Now CGameLoader loads the metadata unconditinally because we didn't
actually use the option to not load load it.

Ref #2415

This was SVN commit r15589.
2014-07-31 14:44:51 +00:00
cf563657b6 Add some information about gathered resources to the multiple selection panel's tooltips. Refs #2695
This was SVN commit r15588.
2014-07-31 12:46:33 +00:00
cf121baa1d Petra: small changes in naval transport to (hopefully) make it more robust
This was SVN commit r15587.
2014-07-30 21:36:48 +00:00
f85272e3de Small code style fix, related to a typo in the documentation. Also updates the Example component's copyright to match the current year.
This was SVN commit r15586.
2014-07-30 17:34:40 +00:00
15e536dbb6 remove the hardcoded StartingCamera of player 3 which was pointing to player 1 location
This was SVN commit r15585.
2014-07-30 16:56:45 +00:00
cd3b35ed52 Handle callback functions when using the "leave" hotkey (by default Esc) to close a message box.
Fixes #2635

This was SVN commit r15584.
2014-07-30 09:27:46 +00:00
707b255e2b Petra: prevent overseas attack to try to start before dock construction
This was SVN commit r15583.
2014-07-29 20:55:16 +00:00
58a19e8e30 Petra: prevent stuck units when a transport ship is destroyed
This was SVN commit r15582.
2014-07-29 17:32:59 +00:00
c2579c3c22 let allies build and repair stuff
This was SVN commit r15581.
2014-07-29 15:57:42 +00:00
00b072ea14 Fix a UnitAI issue where a builder would become idle if, upon completion of a foundation, it was close enough to immediately start working on another foundation. This was particularly infuriating with palisades.
This was SVN commit r15580.
2014-07-29 11:34:58 +00:00
a57747472c Petra: proper fix for the juggernaut limit reported by brian
This was SVN commit r15579.
2014-07-28 20:15:06 +00:00
3ed6681aa4 fix #2691, Petra should not try to unload allied garrisoned inside its buildings
This was SVN commit r15578.
2014-07-28 18:13:49 +00:00
9ce51f4357 Commit coastal waves when activating fancy effects, and incidentally completely change how this effect work. Refs #48.
This was SVN commit r15576.
2014-07-28 10:14:00 +00:00
91ead32b1a petra: temporary fix, waiting to be able to deal with training restrictions
This was SVN commit r15575.
2014-07-27 21:48:02 +00:00
afa769f873 fixes #2690 in Petra AI
This was SVN commit r15574.
2014-07-27 20:45:40 +00:00
2be86ef79e Fix crash when starting Atlas (introduced in 28bdd8540f).
This was SVN commit r15573.
2014-07-27 18:38:31 +00:00
07653c9a70 Fixes crash when generating random maps.
We must not be in a request when calling the ScriptInterface destructor.

This was SVN commit r15572.
2014-07-27 18:17:16 +00:00
cef9e7d4f0 Fixes crash in replay mode introduced in 28bdd8540f.
This was SVN commit r15571.
2014-07-27 17:28:36 +00:00
fe8e19ebfe Bunch of petra bug fixes: fixes #2685, #2686 and makes 074cf06803 really working
This was SVN commit r15570.
2014-07-27 15:25:26 +00:00
64efbfeae3 Fixes small memory leak introduced in 28bdd8540f.
Thanks to leper for pointing it out.

This was SVN commit r15569.
2014-07-26 23:09:24 +00:00
28bdd8540f Quite a lot of stack rooting related changes.
Changes GetProperty, SetProperty and HasProperty and a few other
functions to take handles. The conversions to CScriptVal or
CScriptValRooted at some places should be removed in the future. I've
done that to avoid an even larger patch.

Refs #2415
Refs #2462

This was SVN commit r15568.
2014-07-26 22:33:16 +00:00
e818b08344 Better support for SpiderMonkey rooted types in the ScriptInterface.
* Adds additional overloads/specializations which are required when
passing JS::Handle<T>/JS::MutableHandle<T> types to different functions.
* Replaces GetPropertyJS with a GetProperty specialization.
* Allows us to avoid the implementation of ToJSVal specializations for
JS::Value and JS::HandleValue. Such conversions should only happen if
there's no way around it and if you are aware of it.
* Adds test to make sure that all potentially required specializations
with custom implementations are instantiated. This should help prevent
introducing bugs in temporarily unused code.

Refs #2415

This was SVN commit r15567.
2014-07-26 20:31:29 +00:00
30f7837c44 Should be workaround for issue #2684
This was SVN commit r15566.
2014-07-26 17:12:45 +00:00
9cd75067bc Workaround for issue #2486
This was SVN commit r15565.
2014-07-26 17:09:49 +00:00
ea708e14bf Some changes on the VisibilityUpdate message system, aimed at correcting recent OOS problems.
I still experience troubles with serialization tests but I played a few
games without OOS. At least these changes will help us to debug more
efficiently the remaining problems.

Fixes initialization of visibility data and update order for LoS-related
systems (territory borders, etc).
Also removes a C-like array and fixes a player ID shifting.

Refs #599

This was SVN commit r15563.
2014-07-26 16:02:18 +00:00
e3888448c4 Removes rooting test.
Rooting works different now and the CScriptVal types are going to be
removed. We will need rooting tests again, but they will have to work
completely different than this test implementation.

Refs #2415

This was SVN commit r15562.
2014-07-26 14:07:56 +00:00
f41d4fa48e Fixes compartment mismatch introduced in a5ebd8dafd.
Also modifies some related functions to use SpiderMonkey stack rooting
types instead of CScriptValRooted.

Refs #2415

This was SVN commit r15561.
2014-07-26 10:58:24 +00:00
5c3f1b6dba fix previous commit
This was SVN commit r15560.
2014-07-25 21:24:05 +00:00
074cf06803 Petra: deals more efficiently with naval transport
This was SVN commit r15559.
2014-07-25 18:16:33 +00:00
05de9def0b Remove unused --with-system-enet option (see 6bec648833) from premake.
Sort options in premake.

This was SVN commit r15558.
2014-07-25 13:50:59 +00:00
f017922910 Update system icons to the newer logo and add higher resolution images to the ico/icns sets. (the OS X icon might need to be checked as I had to use an online converter to get that.)
This was SVN commit r15557.
2014-07-24 23:12:46 +00:00
7c82e59ce5 Replace or remove uses of Engine.Console_Write. Patch by Adrian Fatol. Fixes #2141.
Cleans up list utility functions a bit.
Removes Engine.Console_Write.

This was SVN commit r15556.
2014-07-24 21:27:24 +00:00
4278e93b97 Petra: improve AI behaviour in scenarios without building possibility
This was SVN commit r15555.
2014-07-24 21:26:53 +00:00
f8cbef8379 fix previous commit
This was SVN commit r15554.
2014-07-24 21:05:16 +00:00
c5929ca7d5 make tooltip agree with buildrestrictions
This was SVN commit r15553.
2014-07-24 20:59:25 +00:00
a574ca2e8f Petra: improve use of garrisoning for defense + some cleanings
This was SVN commit r15552.
2014-07-23 17:57:32 +00:00
2eb12c13ec give war ships at dock for carthage, for better balance of naval maps
This was SVN commit r15551.
2014-07-23 17:18:22 +00:00
600e0a4081 Fix an oversight in CcmpPosition from the turret changes. Reported on IRC by Falsevision.
This was SVN commit r15550.
2014-07-23 13:02:42 +00:00
a5ebd8dafd Load trigger scripts in serialization test mode.
This was SVN commit r15549.
2014-07-22 23:30:27 +00:00
bfe1e9f182 fix #2603
This was SVN commit r15548.
2014-07-22 21:23:25 +00:00
a7b18d02bf Add serialization test support for replays.
This was SVN commit r15547.
2014-07-22 19:41:49 +00:00
b41289807a fix a rare JS warning
This was SVN commit r15546.
2014-07-22 18:20:47 +00:00
68121f387c Don't cache (and serialise) all technology templates multiple times. It's still cached once in the TechnologyTemplateManager.
This was SVN commit r15545.
2014-07-22 16:18:37 +00:00
9d505f2fd1 fixes petra javascript warnings
This was SVN commit r15543.
2014-07-21 16:19:59 +00:00
a9048fa43d Adds support for passing JS::HandleValue to SetProperty and CallFunctionVoid without using ugly casing.
Also includes one little "demo-usecase", but additional code will be
changed to use that in future commits.

Refs #2415
Refs #2462

This was SVN commit r15542.
2014-07-20 19:45:18 +00:00
31f9ca9ebf Implements CallFunction with JS::MutableHandle<T> return type.
Changes the CallFunction implementation to use macros because otherwise
we'd have to write twice as many functions manually.
Adapts GetSavedGameData to use the new function template. Additional
callers will be changed in future commits.

Refs #2415
Refs #2462

This was SVN commit r15541.
2014-07-20 15:08:28 +00:00
3782857333 Petra: small fixes + reformat debug outputs
This was SVN commit r15540.
2014-07-19 16:17:09 +00:00