diff --git a/.gitmodules b/.gitmodules index adf6beaea1..d2420043fd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "YRpp"] path = YRpp - url = git@github.com:Phobos-developers/YRpp.git + url = https://github.com/Phobos-developers/YRpp.git diff --git a/README.md b/README.md index 84b96cd577..b7b417a8a4 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ Credits - **4SG** - help with docs - **wiktorderelf** - overhauled Unicode font - **Uranusian (Thrifinesma)** - Mind Control enhancement, custom warhead splash list, harvesters counter, promoted spawns, shields, death after dead fix, customizeable missing cameo, cameo sorting priority, placement mode responding of tab hotkeys fix, producing progress, custom ore gathering anim, NoManualMove, weapon target house filtering, DeathWeapon fix, re-enable obsolete `JumpjetControls`, AITrigger Building Upgrades recognition, Wall-Gate links, deployed infantry using both weapons, overhauled Unicode font, docs maintenance, CN docs translation -- **secsome (SEC-SOME)** - debug info dump hotkey, refactoring & porting of Ares helper code, introducing more Ares-derived stuff, disguise removal warhead, Mind Control removal warhead, Mind Control enhancement, shields, AnimList.PickRandom, MoveToCell fix, unlimited waypoints, Build At trigger action buildup anim fix, Undeploy building into a unit plays `EVA_NewRallyPointEstablished` fix, custom ore gathering anim, TemporaryClass related crash, Retry dialog on mission failure, Default disguise for individual InfantryTypes, PowerPlant Enhancer, SaveGame Trigger Action, QuickSave command, Numeric variables, Custom gravity for projectiles, Retint map actions bugfix, Sharpnel enhancement +- **secsome (SEC-SOME)** - debug info dump hotkey, refactoring & porting of Ares helper code, introducing more Ares-derived stuff, disguise removal warhead, Mind Control removal warhead, Mind Control enhancement, shields, AnimList.PickRandom, MoveToCell fix, unlimited waypoints, Build At trigger action buildup anim fix, Undeploy building into a unit plays `EVA_NewRallyPointEstablished` fix, custom ore gathering anim, TemporaryClass related crash, Retry dialog on mission failure, Default disguise for individual InfantryTypes, PowerPlant Enhancer, SaveGame Trigger Action, QuickSave command, Numeric variables, Custom gravity for projectiles, Retint map actions bugfix, Sharpnel enhancement, Vanilla map preview reading bugfix - **Otamaa (Fahroni, BoredEXE)** - help with CellSpread, ported and fixed custom RadType code, togglable ElectricBolt bolts, customizable Chrono Locomotor properties per TechnoClass, DebrisMaximums fixes, Anim-to-Unit, NotHuman anim sequences improvements, Customizable OpenTopped Properties, hooks for ScriptType Actions 92 & 93, ore stage threshold for `HideIfNoOre`, occupied building `MuzzleFlashX` bugfix,`EnemyUIName=` for other TechnoTypes, TerrainType `DestroyAnim` & `DestroySound`, Laser trails for VoxelAnims - **E1 Elite** - TileSet 255 and above bridge repair fix - **FS-21** - Dump Object Info enhancements, Powered.KillSpawns, Spawner.LimitRange, ScriptType Actions 71 to 113, MC deployer fixes, help with docs, Automatic Passenger Deletion, Fire SW At Location Trigger Action, Fire SW At Waypoint Trigger Action, Kill Object Automatically, Customize resource storage, Override Uncloaked Underwater attack behavior, AI Aircraft docks fix, Shared Ammo diff --git a/docs/Fixed-or-Improved-Logics.md b/docs/Fixed-or-Improved-Logics.md index bf834f7675..bcd0f1280b 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -4,6 +4,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho ## Bugfixes and miscellaneous +- Fixed the bug when reading a map which puts `Preview(Pack)` after `Map` lead to the game fail to draw the preview (by secsome) - Fixed the bug when retinting map lighting with a map action corrupted light sources. - Fixed the bug when deploying mindcontrolled vehicle into a building permanently transferred the control to the house which mindcontrolled it. - Fixed the bug when units are already dead but still in map (for sinking, crashing, dying animation, etc.), they could die again. diff --git a/docs/Whats-New.md b/docs/Whats-New.md index 347b277398..9235b48eee 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -286,6 +286,7 @@ Vanilla fixes: - Fixed buildings with `Naval=yes` ignoring `WaterBound=no` to be forced to place onto water (by Uranusian) - Fixed temporal weapon crash under certain conditions where stack dump starts with 0051BB7D (by secsome) - Fixed the bug when retinting map lighting with a map action corrupted light sources (by secsome) +- Fixed the bug when reading a map which puts `Preview(Pack)` after `Map` lead to the game fail to draw the preview (by secsome) - Fixed the bug that AITriggerTypes do not recognize building upgrades (by Uranusian) - Fixed AI Aircraft docks bug when Ares tag `[GlobalControls]` > `AllowParallelAIQueues=no` is set (by FS-21) - Fixed the bug when occupied building's `MuzzleFlashX` is drawn on the center of the building when `X` goes past 10 (by Otamaa) diff --git a/src/Misc/Hooks.UI.cpp b/src/Misc/Hooks.UI.cpp index 435eb682da..25f49e9c84 100644 --- a/src/Misc/Hooks.UI.cpp +++ b/src/Misc/Hooks.UI.cpp @@ -1,6 +1,7 @@ #include #include +#include #include #include @@ -49,6 +50,29 @@ DEFINE_HOOK(0x641B41, LoadingScreen_SkipPreview, 0x8) return 0x641D4E; } +DEFINE_HOOK(0x641EE0, PreviewClass_ReadPreview, 0x6) +{ + GET(PreviewClass*, pThis, ECX); + GET_STACK(const char*, lpMapFile, 0x4); + + CCFileClass file(lpMapFile); + if (file.Exists() && file.Open(FileAccessMode::Read)) + { + CCINIClass ini; + ini.ReadCCFile(&file, true); + ini.CurrentSection = nullptr; + ini.CurrentSectionName = nullptr; + + ScenarioClass::Instance->ReadStartPoints(ini); + + R->EAX(pThis->ReadPreviewPack(ini)); + } + else + R->EAX(false); + + return 0x64203D; +} + DEFINE_HOOK(0x4A25E0, CreditsClass_GraphicLogic_HarvesterCounter, 0x7) { if (Phobos::UI::ShowHarvesterCounter)