@@ -153,6 +153,7 @@ bool CoreStartEmulation(std::filesystem::path n64rom, std::filesystem::path n64d
153
153
m64p_error m64p_ret;
154
154
bool netplay_ret = false ;
155
155
CoreRomType type;
156
+ bool netplay = !address.empty ();
156
157
157
158
if (!CoreOpenRom (n64rom))
158
159
{
@@ -180,7 +181,7 @@ bool CoreStartEmulation(std::filesystem::path n64rom, std::filesystem::path n64d
180
181
return false ;
181
182
}
182
183
183
- if (!address. empty () )
184
+ if (netplay )
184
185
{ // netplay cheats
185
186
if (!CoreApplyNetplayCheats ())
186
187
{
@@ -230,7 +231,7 @@ bool CoreStartEmulation(std::filesystem::path n64rom, std::filesystem::path n64d
230
231
#endif // DISCORD_RPC
231
232
232
233
#ifdef NETPLAY
233
- if (!address. empty () )
234
+ if (netplay )
234
235
{
235
236
netplay_ret = CoreInitNetplay (address, port, player);
236
237
if (!netplay_ret)
@@ -242,7 +243,7 @@ bool CoreStartEmulation(std::filesystem::path n64rom, std::filesystem::path n64d
242
243
243
244
// only start emulation when initializing netplay
244
245
// is successful or if there's no netplay requested
245
- if (address. empty () || netplay_ret)
246
+ if (!netplay || netplay_ret)
246
247
{
247
248
m64p_ret = m64p::Core.DoCommand (M64CMD_EXECUTE, 0 , nullptr );
248
249
if (m64p_ret != M64ERR_SUCCESS)
@@ -253,7 +254,7 @@ bool CoreStartEmulation(std::filesystem::path n64rom, std::filesystem::path n64d
253
254
}
254
255
255
256
#ifdef NETPLAY
256
- if (!address. empty () && netplay_ret)
257
+ if (netplay && netplay_ret)
257
258
{
258
259
CoreShutdownNetplay ();
259
260
}
@@ -273,7 +274,7 @@ bool CoreStartEmulation(std::filesystem::path n64rom, std::filesystem::path n64d
273
274
CoreDiscordRpcUpdate (false );
274
275
#endif // DISCORD_RPC
275
276
276
- if (address. empty () || netplay_ret)
277
+ if (!netplay || netplay_ret)
277
278
{
278
279
// we need to set the emulation error last,
279
280
// to prevent the other functions from
0 commit comments