Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 9dcb79f

Browse files
committed
Merge branch 'development'
2 parents 6dfc853 + 973eb24 commit 9dcb79f

File tree

15 files changed

+127
-101
lines changed

15 files changed

+127
-101
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,8 @@ This can be accessed via the new Lua (R/W) `SettingsMan` property `AIUpdateInter
851851

852852
- New `Activity` Lua function `activity:SetPlayerHadBrain(player, whetherOrNotPlayerHadBrain)`, which sets whether or not the given player had a brain. Probably mostly useful for dealing with loading a game with multiple players, where one player is dead and you have to sort out brain assignment.
853853

854+
- Changed `LuaMan:FileOpen` access modes so it only allows `"r", "r+", "w", "w+", "a", "a+"`, i.e. specifying type (text, binary) is not supported. See [this reference page](https://cplusplus.com/reference/cstdio/fopen) for details on the access modes.
855+
854856
</details>
855857

856858
<details><summary><b>Fixed</b></summary>

Entities/AHuman.cpp

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,7 @@ bool AHuman::UnequipBGArm() {
12981298
if (m_pBGArm) {
12991299
if (HeldDevice *heldDevice = m_pBGArm->GetHeldDevice()) {
13001300
heldDevice->Deactivate();
1301-
AddToInventoryBack(m_pBGArm->RemoveAttachable(heldDevice));
1301+
AddToInventoryFront(m_pBGArm->RemoveAttachable(heldDevice));
13021302
m_pBGArm->SetHandPos(m_Pos + RotateOffset(m_HolsterOffset));
13031303
return true;
13041304
}
@@ -3151,7 +3151,10 @@ void AHuman::Update()
31513151
}
31523152
}
31533153
// Disengage the prone state as soon as crouch is released.
3154-
if (!crouching) { m_ProneState = NOTPRONE; }
3154+
if (!crouching && m_ProneState != NOTPRONE) {
3155+
EquipShieldInBGArm();
3156+
m_ProneState = NOTPRONE;
3157+
}
31553158
}
31563159

31573160
////////////////////////////////////
@@ -3303,6 +3306,8 @@ void AHuman::Update()
33033306
if (deviceAsFirearm->FiredOnce()) {
33043307
m_CanActivateBGItem = true;
33053308
m_TriggerPulled = true;
3309+
} else {
3310+
m_CanActivateBGItem = !deviceAsFirearm->CanFire();
33063311
}
33073312
}
33083313
}
@@ -3399,6 +3404,8 @@ void AHuman::Update()
33993404
if (deviceAsFirearm->FiredOnce()) {
34003405
m_CanActivateBGItem = false;
34013406
m_TriggerPulled = true;
3407+
} else {
3408+
m_CanActivateBGItem = deviceAsFirearm->CanFire();
34023409
}
34033410
}
34043411
} else {
@@ -3448,27 +3455,31 @@ void AHuman::Update()
34483455
// Item dropping logic
34493456

34503457
if (m_Controller.IsState(WEAPON_DROP) && m_Status != INACTIVE) {
3451-
bool anyDropped = false;
3458+
Arm *dropperArm = nullptr;
34523459
for (Arm *arm : { m_pFGArm, m_pBGArm }) {
3453-
if (!anyDropped && arm && arm->GetHeldDevice()) {
3460+
if (arm && arm->GetHeldDevice()) {
34543461
HeldDevice *heldDevice = arm->GetHeldDevice();
34553462
arm->RemoveAttachable(heldDevice, true, false);
3463+
if (dropperArm) {
3464+
if (heldDevice) {
3465+
dropperArm->SetHeldDevice(heldDevice);
3466+
arm->SetHandPos(dropperArm->GetPos());
3467+
}
3468+
} else {
3469+
heldDevice->SetPos(arm->GetJointPos() + Vector(arm->GetMaxLength() * GetFlipFactor(), 0).RadRotate(adjustedAimAngle));
3470+
Vector tossVec(1.0F + std::sqrt(std::abs(arm->GetThrowStrength()) / std::sqrt(std::abs(heldDevice->GetMass()) + 1.0F)), RandomNormalNum());
3471+
heldDevice->SetVel(heldDevice->GetVel() * 0.5F + tossVec.RadRotate(m_AimAngle).GetXFlipped(m_HFlipped));
3472+
heldDevice->SetAngularVel(heldDevice->GetAngularVel() + m_AngularVel * 0.5F + 3.0F * RandomNormalNum());
34563473

3457-
heldDevice->SetPos(arm->GetJointPos() + Vector(arm->GetMaxLength() * GetFlipFactor(), 0).RadRotate(adjustedAimAngle));
3458-
Vector tossVec(1.0F + std::sqrt(std::abs(arm->GetThrowStrength()) / std::sqrt(std::abs(heldDevice->GetMass()) + 1.0F)), RandomNormalNum());
3459-
heldDevice->SetVel(heldDevice->GetVel() * 0.5F + tossVec.RadRotate(m_AimAngle).GetXFlipped(m_HFlipped));
3460-
heldDevice->SetAngularVel(heldDevice->GetAngularVel() + m_AngularVel * 0.5F + 3.0F * RandomNormalNum());
3461-
3462-
arm->SetHandPos(heldDevice->GetPos());
3463-
if (!m_Inventory.empty()) {
3464-
arm->SetHeldDevice(dynamic_cast<HeldDevice *>(SwapNextInventory()));
3465-
arm->SetHandPos(m_Pos + RotateOffset(m_HolsterOffset));
3474+
arm->SetHandPos(heldDevice->GetPos());
34663475
}
3467-
anyDropped = true;
3468-
break;
3476+
dropperArm = arm;
3477+
} else if (dropperArm && !m_Inventory.empty()) {
3478+
dropperArm->SetHeldDevice(dynamic_cast<HeldDevice*>(SwapNextInventory()));
3479+
dropperArm->SetHandPos(m_Pos + RotateOffset(m_HolsterOffset));
34693480
}
34703481
}
3471-
if (!anyDropped && !m_Inventory.empty() && !m_pFGArm) {
3482+
if (!dropperArm && !m_Inventory.empty() && !m_pFGArm) {
34723483
DropAllInventory();
34733484
if (m_pBGArm) {
34743485
m_pBGArm->SetHandPos(m_Pos + RotateOffset(m_HolsterOffset));

Entities/Actor.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ void Actor::GibThis(const Vector &impactImpulse, MovableObject *movableObjectToI
10871087
m_Inventory.clear();
10881088

10891089
// If this is the actual brain of any player, flash that player's screen when he's now dead
1090-
if (g_SettingsMan.FlashOnBrainDamage())
1090+
if (g_SettingsMan.FlashOnBrainDamage() && g_ActivityMan.IsInActivity())
10911091
{
10921092
int brainOfPlayer = g_ActivityMan.GetActivity()->IsBrainOfWhichPlayer(this);
10931093
// Only flash if player is human (AI players don't have screens!)
@@ -1221,6 +1221,9 @@ MOID Actor::GetAIMOWaypointID() const
12211221

12221222
bool Actor::UpdateMovePath()
12231223
{
1224+
if (g_SceneMan.GetScene() == nullptr) {
1225+
return false;
1226+
}
12241227
// TODO: Do throttling of calls for this function over time??
12251228

12261229
// Estimate how much material this actor can dig through
@@ -1537,7 +1540,7 @@ void Actor::Update()
15371540
////////////////////////////////
15381541
// Death logic
15391542

1540-
if (m_Status != DYING && m_Status != DEAD && std::round(m_Health) <= 0) {
1543+
if (m_Status != DYING && m_Status != DEAD && m_Health <= 0) {
15411544
if (m_DeathSound) { m_DeathSound->Play(m_Pos); }
15421545
m_Controller.SetDisabled(true);
15431546
DropAllInventory();
@@ -1800,7 +1803,7 @@ void Actor::DrawHUD(BITMAP *pTargetBitmap, const Vector &targetPos, int whichScr
18001803
pSymbolFont->DrawAligned(&bitmapInt, drawPos.m_X - 11, drawPos.m_Y + m_HUDStack, str, GUIFont::Left);
18011804
}
18021805
*/
1803-
std::snprintf(str, sizeof(str), "%.0f", m_Health);
1806+
std::snprintf(str, sizeof(str), "%.0f", std::ceil(m_Health));
18041807
pSymbolFont->DrawAligned(&bitmapInt, drawPos.m_X - 0, drawPos.m_Y + m_HUDStack, str, GUIFont::Left);
18051808

18061809
m_HUDStack += -12;

Entities/HDFirearm.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,14 +1172,12 @@ void HDFirearm::DrawHUD(BITMAP *pTargetBitmap, const Vector &targetPos, int whic
11721172
}
11731173

11741174
float sharpLength = std::max(m_MaxSharpLength * m_SharpAim, 20.0F);
1175-
int glowStrength;
1175+
int glowStrength = RandomNum(95, 159);
11761176
int pointCount;
11771177
if (playerControlled && sharpLength > 20.0F) {
11781178
pointCount = m_SharpAim > 0.5F ? 4 : 3;
1179-
glowStrength = RandomNum(127, 255);
11801179
} else {
11811180
pointCount = 2;
1182-
glowStrength = RandomNum(63, 127);
11831181
}
11841182
int pointSpacing = 10 - pointCount;
11851183
sharpLength -= static_cast<float>(pointSpacing * pointCount) * 0.5F;

Entities/HDFirearm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ AddScriptFunctionNames(HeldDevice, "OnFire", "OnReload");
821821
/// Gets whether this HDFirearm is ready to be fired.
822822
/// </summary>
823823
/// <returns>Whether this HDFirearm is ready to pop another Round.</returns>
824-
bool CanFire() const { return m_ActivationTimer.IsPastSimMS(GetMSPerRound()); }
824+
bool CanFire() const { return m_LastFireTmr.IsPastSimMS(GetMSPerRound()); }
825825

826826
/// <summary>
827827
/// Gets whether this HDFirearm is halfway to be fired. Used for evenly spacing out dual-wielded fire.

Main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ namespace RTE {
5959
g_NetworkServer.Initialize();
6060
g_NetworkClient.Initialize();
6161
g_TimerMan.Initialize();
62-
g_PerformanceMan.Initialize();
6362
g_WindowMan.Initialize();
6463
g_FrameMan.Initialize();
6564
g_PostProcessMan.Initialize();
65+
g_PerformanceMan.Initialize();
6666

6767
if (g_AudioMan.Initialize()) { g_GUISound.Initialize(); }
6868

@@ -95,6 +95,7 @@ namespace RTE {
9595
g_AudioMan.Destroy();
9696
g_PresetMan.Destroy();
9797
g_UInputMan.Destroy();
98+
g_PostProcessMan.Destroy();
9899
g_FrameMan.Destroy();
99100
g_TimerMan.Destroy();
100101
g_LuaMan.Destroy();

Managers/AudioMan.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,10 @@ namespace RTE {
233233
FMOD::Sound *musicSound;
234234
result = (result == FMOD_OK) ? musicChannel->getCurrentSound(&musicSound) : result;
235235

236-
unsigned int musicLength;
236+
unsigned int musicLength = 0;
237237
result = (result == FMOD_OK) ? musicSound->getLength(&musicLength, FMOD_TIMEUNIT_MS) : result;
238238

239-
position = std::clamp(position, 0.0F, static_cast<float>(musicLength)) / 1000.0F;
240-
result = (result == FMOD_OK) ? musicChannel->setPosition(static_cast<unsigned int>(position), FMOD_TIMEUNIT_MS) : result;
239+
result = (result == FMOD_OK) ? musicChannel->setPosition(std::clamp(static_cast<unsigned int>(position * 1000.0F), 0U, musicLength), FMOD_TIMEUNIT_MS) : result;
241240

242241
if (result != FMOD_OK) { g_ConsoleMan.PrintString("ERROR: Could not set music position: " + std::string(FMOD_ErrorString(result))); }
243242
}

Managers/FrameMan.cpp

Lines changed: 46 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ namespace RTE {
6262
m_BlackColor = 245;
6363
m_AlmostBlackColor = 245;
6464
m_ColorTablePruneTimer.Reset();
65-
m_GUIScreen = nullptr;
66-
m_LargeFont = nullptr;
67-
m_SmallFont = nullptr;
65+
m_GUIScreens.fill(nullptr);
66+
m_LargeFonts.fill(nullptr);
67+
m_SmallFonts.fill(nullptr);
6868
m_TextBlinkTimer.Reset();
6969

7070
for (int screenCount = 0; screenCount < c_MaxScreenCount; ++screenCount) {
@@ -89,7 +89,7 @@ namespace RTE {
8989
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
9090

9191
int FrameMan::Initialize() {
92-
set_color_depth(m_BPP);
92+
set_color_depth(c_BPP);
9393
// Sets the allowed color conversions when loading bitmaps from files
9494
set_color_conversion(COLORCONV_MOST);
9595

@@ -122,10 +122,10 @@ namespace RTE {
122122
ClearBackBuffer8();
123123

124124
// Create the post-processing buffer, it'll be used for glow effects etc
125-
m_BackBuffer32 = std::unique_ptr<BITMAP, BitmapDeleter>(create_bitmap_ex(32, resX, resY));
125+
m_BackBuffer32 = std::unique_ptr<BITMAP, BitmapDeleter>(create_bitmap_ex(c_BPP, resX, resY));
126126
ClearBackBuffer32();
127127

128-
m_OverlayBitmap32 = std::unique_ptr<BITMAP, BitmapDeleter>(create_bitmap_ex(32, resX, resY));
128+
m_OverlayBitmap32 = std::unique_ptr<BITMAP, BitmapDeleter>(create_bitmap_ex(c_BPP, resX, resY));
129129
clear_to_color(m_OverlayBitmap32.get(), 0);
130130

131131
// Create all the network 8bpp back buffers
@@ -187,10 +187,15 @@ namespace RTE {
187187
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
188188

189189
void FrameMan::Destroy() {
190-
delete m_GUIScreen;
191-
delete m_LargeFont;
192-
delete m_SmallFont;
193-
190+
for (const GUIScreen *guiScreen : m_GUIScreens) {
191+
delete guiScreen;
192+
}
193+
for (const GUIFont *guiFont : m_LargeFonts) {
194+
delete guiFont;
195+
}
196+
for (const GUIFont *guiFont : m_SmallFonts) {
197+
delete guiFont;
198+
}
194199
Clear();
195200
}
196201

@@ -326,7 +331,7 @@ namespace RTE {
326331
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
327332

328333
std::string FrameMan::SplitStringToFitWidth(const std::string &stringToSplit, int widthLimit, bool useSmallFont) {
329-
GUIFont *fontToUse = GetFont(useSmallFont);
334+
GUIFont *fontToUse = GetFont(useSmallFont, false);
330335
auto SplitSingleLineAsNeeded = [this, &widthLimit, &fontToUse](std::string &lineToSplitAsNeeded) {
331336
int numberOfScreenWidthsForText = static_cast<int>(std::ceil(static_cast<float>(fontToUse->CalculateWidth(lineToSplitAsNeeded)) / static_cast<float>(widthLimit)));
332337
if (numberOfScreenWidthsForText > 1) {
@@ -550,12 +555,12 @@ namespace RTE {
550555
case ScenePreviewDump:
551556
case WorldDump:
552557
if (!m_WorldDumpBuffer || (m_WorldDumpBuffer->w != g_SceneMan.GetSceneWidth() || m_WorldDumpBuffer->h != g_SceneMan.GetSceneHeight())) {
553-
m_WorldDumpBuffer = std::unique_ptr<BITMAP, BitmapDeleter>(create_bitmap_ex(32, g_SceneMan.GetSceneWidth(), g_SceneMan.GetSceneHeight()));
558+
m_WorldDumpBuffer = std::unique_ptr<BITMAP, BitmapDeleter>(create_bitmap_ex(c_BPP, g_SceneMan.GetSceneWidth(), g_SceneMan.GetSceneHeight()));
554559
}
555560
if (modeToSave == ScenePreviewDump) {
556561
DrawWorldDump(true);
557562

558-
BITMAP *scenePreviewDumpBuffer = create_bitmap_ex(32, c_ScenePreviewWidth, c_ScenePreviewHeight);
563+
BITMAP *scenePreviewDumpBuffer = create_bitmap_ex(c_BPP, c_ScenePreviewWidth, c_ScenePreviewHeight);
559564
blit(m_ScenePreviewDumpGradient.get(), scenePreviewDumpBuffer, 0, 0, 0, 0, scenePreviewDumpBuffer->w, scenePreviewDumpBuffer->h);
560565
masked_stretch_blit(m_WorldDumpBuffer.get(), scenePreviewDumpBuffer, 0, 0, m_WorldDumpBuffer->w, m_WorldDumpBuffer->h, 0, 0, scenePreviewDumpBuffer->w, scenePreviewDumpBuffer->h);
561566

@@ -714,21 +719,39 @@ namespace RTE {
714719

715720
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
716721

717-
GUIFont * FrameMan::GetFont(bool isSmall) {
718-
if (!m_GUIScreen) { m_GUIScreen = new AllegroScreen(m_BackBuffer8.get()); }
722+
GUIFont * FrameMan::GetFont(bool isSmall, bool trueColor) {
723+
size_t colorIndex = trueColor ? 1 : 0;
724+
725+
if (!m_GUIScreens[colorIndex]) {
726+
m_GUIScreens[colorIndex] = new AllegroScreen(trueColor ? m_BackBuffer32.get() : m_BackBuffer8.get());
727+
}
719728

720729
if (isSmall) {
721-
if (!m_SmallFont) {
722-
m_SmallFont = new GUIFont("SmallFont");
723-
m_SmallFont->Load(m_GUIScreen, "Base.rte/GUIs/Skins/FontSmall.png");
730+
if (!m_SmallFonts[colorIndex]) {
731+
std::string fontName = "SmallFont";
732+
std::string fontPath = "Base.rte/GUIs/Skins/FontSmall.png";
733+
734+
if (trueColor) {
735+
fontName = "SmallFont32";
736+
fontPath = "Base.rte/GUIs/Skins/Menus/FontSmall.png";
737+
}
738+
m_SmallFonts[colorIndex] = new GUIFont(fontName);
739+
m_SmallFonts[colorIndex]->Load(m_GUIScreens[colorIndex], fontPath);
724740
}
725-
return m_SmallFont;
741+
return m_SmallFonts[colorIndex];
726742
}
727-
if (!m_LargeFont) {
728-
m_LargeFont = new GUIFont("FatFont");
729-
m_LargeFont->Load(m_GUIScreen, "Base.rte/GUIs/Skins/FontLarge.png");
743+
if (!m_LargeFonts[colorIndex]) {
744+
std::string fontName = "FatFont";
745+
std::string fontPath = "Base.rte/GUIs/Skins/FontLarge.png";
746+
747+
if (trueColor) {
748+
fontName = "FatFont32";
749+
fontPath = "Base.rte/GUIs/Skins/Menus/FontLarge.png";
750+
}
751+
m_LargeFonts[colorIndex] = new GUIFont(fontName);
752+
m_LargeFonts[colorIndex]->Load(m_GUIScreens[colorIndex], fontPath);
730753
}
731-
return m_LargeFont;
754+
return m_LargeFonts[colorIndex];
732755
}
733756

734757
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Managers/FrameMan.h

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ namespace RTE {
2727

2828
public:
2929

30+
static constexpr int c_BPP = 32; //!< Color depth (bits per pixel).
31+
3032
Vector SLOffset[c_MaxScreenCount][c_MaxLayersStoredForNetwork]; //!< SceneLayer offsets for each screen in online multiplayer.
3133

3234
#pragma region Creation
@@ -174,14 +176,16 @@ namespace RTE {
174176
/// <summary>
175177
/// Gets the small font from the GUI engine's current skin. Ownership is NOT transferred!
176178
/// </summary>
179+
/// <param name="trueColor">Whether to get the 32bpp color version of the font.</param>
177180
/// <returns>A pointer to the requested font, or 0 if no small font was found.</returns>
178-
GUIFont * GetSmallFont() { return GetFont(true); }
181+
GUIFont * GetSmallFont(bool trueColor = false) { return GetFont(true, trueColor); }
179182

180183
/// <summary>
181184
/// Gets the large font from the GUI engine's current skin. Ownership is NOT transferred!
182185
/// </summary>
186+
/// <param name="trueColor">Whether to get the 32bpp color version of the font.</param>
183187
/// <returns>A pointer to the requested font, or 0 if no large font was found.</returns>
184-
GUIFont * GetLargeFont() { return GetFont(false); }
188+
GUIFont * GetLargeFont(bool trueColor = false) { return GetFont(false, trueColor); }
185189

186190
/// <summary>
187191
/// Calculates the width of a text string using the given font size.
@@ -466,8 +470,6 @@ namespace RTE {
466470
/// </summary>
467471
enum SaveBitmapMode { SingleBitmap, ScreenDump, WorldDump, ScenePreviewDump };
468472

469-
static constexpr int m_BPP = 32; //!< Color depth (bits per pixel).
470-
471473
static const std::array<std::function<void(int r, int g, int b, int a)>, DrawBlendMode::BlendModeCount> c_BlenderSetterFunctions; //!< Array of function references to Allegro blender setters for convenient access when creating new color tables.
472474

473475
bool m_HSplit; //!< Whether the screen is split horizontally across the screen, ie as two splitscreens one above the other.
@@ -493,9 +495,9 @@ namespace RTE {
493495
int m_PlayerScreenWidth; //!< Width of the screen of each player. Will be smaller than resolution only if the screen is split.
494496
int m_PlayerScreenHeight; //!< Height of the screen of each player. Will be smaller than resolution only if the screen is split.
495497

496-
AllegroScreen *m_GUIScreen; //!< GUI screen object kept and owned just for the fonts.
497-
GUIFont *m_SmallFont; //!< Pointer to the standard small font for quick access.
498-
GUIFont *m_LargeFont; //!< Pointer to the standard large font for quick access.
498+
std::array<AllegroScreen *, 2> m_GUIScreens; //!< GUI screen objects kept and owned just for the fonts.
499+
std::array<GUIFont *, 2> m_SmallFonts; //!< Pointers to the standard small font for quick access.
500+
std::array<GUIFont *, 2> m_LargeFonts; //!< Pointers to the standard large font for quick access.
499501

500502
std::string m_ScreenText[c_MaxScreenCount]; //!< The text to be displayed on each player's screen.
501503
bool m_TextCentered[c_MaxScreenCount]; //!< Whether screen text is centered vertically.
@@ -626,8 +628,9 @@ namespace RTE {
626628
/// Gets the requested font from the GUI engine's current skin. Ownership is NOT transferred!
627629
/// </summary>
628630
/// <param name="isSmall">Size of font to get. True for small font, false for large font.</param>
631+
/// <param name="trueColor">Whether to get the 32bpp color version of the font.</param>
629632
/// <returns>A pointer to the requested font, or 0 if no font was found.</returns>
630-
GUIFont * GetFont(bool isSmall);
633+
GUIFont * GetFont(bool isSmall, bool trueColor);
631634

632635
/// <summary>
633636
/// Clears all the member variables of this FrameMan, effectively resetting the members of this abstraction level only.

Managers/LuaMan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ namespace RTE {
542542
return -1;
543543
}
544544

545-
std::string fullPath = System::GetWorkingDirectory() + fileName;
545+
std::string fullPath = System::GetWorkingDirectory() + g_PresetMan.GetFullModulePath(fileName);
546546
if ((fullPath.find("..") == std::string::npos) && (fullPath.find(System::GetModulePackageExtension()) != std::string::npos)) {
547547

548548
#ifdef _WIN32

0 commit comments

Comments
 (0)