Skip to content

Commit

Permalink
Merge pull request #1 from Phobos-developers/develop
Browse files Browse the repository at this point in the history
merge from phobos main repo
  • Loading branch information
secsome committed Mar 6, 2021
2 parents 4295e4c + 765779d commit f009425
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 8 deletions.
3 changes: 1 addition & 2 deletions Phobos.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
<ClCompile Include="src\Misc\Savegame.cpp" />
<ClCompile Include="src\Misc\ExtendedToolTips.cpp" />
<ClCompile Include="src\Misc\Selection.cpp" />
<ClCompile Include="src\Misc\Tileset255Fix.cpp" />
<ClCompile Include="src\Utilities\Debug.cpp" />
<ClCompile Include="src\Ext\BuildingType\Body.cpp" />
<ClCompile Include="src\Ext\Building\Body.cpp" />
<ClCompile Include="src\Ext\WarheadType\Body.cpp" />
<ClCompile Include="src\Ext\WarheadType\Hooks.cpp" />
<ClCompile Include="src\Ext\_Container.cpp" />
Expand Down Expand Up @@ -55,7 +55,6 @@
<ClInclude Include="src\Utilities\Constructs.h" />
<ClInclude Include="src\Utilities\Debug.h" />
<ClInclude Include="src\Ext\BuildingType\Body.h" />
<ClInclude Include="src\Ext\Building\Body.h" />
<ClInclude Include="src\Ext\WarheadType\Body.h" />
<ClInclude Include="src\Ext\_Container.hpp" />
<ClInclude Include="src\Phobos.h" />
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Credits
- Thrifinesma (Uranusian) - mind control range limit and custom warhead splash list implementation
- SEC-SOME (secsome) - debug info dump hotkey, refactoring, introducing more Ares-derived stuff, disguise removal warhead
- Otamaa (BoredEXE) - help with CellSpread
- E1 Elite - TileSet 255 and above bridge repair fix

Thanks to everyone who uses Phobos, tests changes and reports bugs! You can show your appreciation and help project by displaying the logo (monochrome version can be found [here](logo-mono.png)) in your client/launcher, [contributing](https://github.com/Phobos-developers/Phobos/wiki/Contributing) or donating to us via links on the right and the `Sponsor` button on top of the repo.

Expand Down
5 changes: 3 additions & 2 deletions src/Ext/BuildingType/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ void BuildingTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) {

this->PowersUp_Owner.Read(exINI, pSection, "PowersUp.Owner");
this->PowersUp_Buildings.Read(exINI, pSection, "PowersUp.Buildings");
if (this->OwnerObject()->PowersUpBuilding[0] == NULL && this->PowersUp_Buildings.size() > 0)
strcpy_s(this->OwnerObject()->PowersUpBuilding, BuildingTypeClass::Array->GetItem(this->PowersUp_Buildings[0])->ID);

if (pThis->PowersUpBuilding[0] == NULL && this->PowersUp_Buildings.size() > 0)
strcpy_s(pThis->PowersUpBuilding, BuildingTypeClass::Array->GetItem(this->PowersUp_Buildings[0])->ID);
}

void BuildingTypeExt::ExtData::LoadFromStream(IStream* Stm) {
Expand Down
3 changes: 2 additions & 1 deletion src/Ext/TechnoType/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) {
this->UIDescription.Read(exINI, pSection, "UIDescription");
this->LowSelectionPriority.Read(exINI, pSection, "LowSelectionPriority");
this->MindControlRangeLimit.Read(exINI, pSection, "MindControlRangeLimit");

// Ares 0.A
this->GroupAs.Read(pINI, "GroupAs", this->GroupAs, this->GroupAs);
this->GroupAs.Read(pINI, pSection, "GroupAs");
}

void TechnoTypeExt::ExtData::LoadFromStream(IStream* Stm) {
Expand Down
4 changes: 2 additions & 2 deletions src/Ext/WeaponType/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ void WeaponTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) {
}

void WeaponTypeExt::ExtData::LoadFromStream(IStream* Stm) {
this->DiskLaser_Radius.Load(Stm);
// this->DiskLaser_Radius.Load(Stm); // There is no need to this. It is used only for LoadFromINIFile
this->DiskLaser_Circumference.Load(Stm);
}

void WeaponTypeExt::ExtData::SaveToStream(IStream* Stm) const {
this->DiskLaser_Radius.Save(Stm);
// this->DiskLaser_Radius.Save(Stm); // There is no need to this. It is used only for LoadFromINIFile
this->DiskLaser_Circumference.Save(Stm);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Misc/ExtendedToolTips.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void ExtToolTip::CreateHelpText(AbstractType itemType, int itemIndex)

// append Time label
const long rechargeTime = pSW ? pSW->RechargeTime : 0;
if (rechargeTime) {
if (rechargeTime > 0) {
const int sec = (rechargeTime / 15) % 60;
const int min = (rechargeTime / 15) / 60;

Expand Down
21 changes: 21 additions & 0 deletions src/Misc/Tileset255Fix.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

/* Allow usage of TileSet of 255 and above without making NE-SW broken bridges unrepairable
When TileSet number crosses 255 in theater INI files, the NE-SW broken bridges
become non-repairable. The reason is that the NonMarbleMadnessTile array of size 256
overflows when filled and affects the variables like BridgeTopRight1 and BridgeBottomLeft2
that come after it. This patch removes the filling of the unused NonMarbleMadnessTile array
and its references.
*/

#include <Helpers/Macro.h>

DEFINE_HOOK(545CE2, Tileset255Fix_RemoveNonMMArrayFill, 0)
{
return 0x545CE9;
}

DEFINE_HOOK(546C23, Tileset255Fix_RefNonMMArray, 0)
{
return 0x546C8B;
}

0 comments on commit f009425

Please sign in to comment.