Skip to content

Commit 024b597

Browse files
authored
Merge branch 'dev' into Item_move_fix
2 parents c08cc63 + e188573 commit 024b597

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+274
-239
lines changed

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 🐛 Bug Report
1+
name: "🐛 Bug Report"
22
description: Report unexpected behavior
33
labels: ["bug"]
44
#assignees:
@@ -40,7 +40,7 @@ body:
4040
required: true
4141
- type: dropdown
4242
id: sphere-branch
43-
attributes:
43+
attributes:
4444
label: Branch
4545
description: "Select the branch you are working with"
4646
options:

.github/ISSUE_TEMPLATE/feature-request.md

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "💡 Feature Request"
2+
description: Suggest an idea.
3+
labels: ["feature"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thank you for taking the time to suggest a feature!
9+
10+
- type: textarea
11+
id: description
12+
attributes:
13+
label: Description
14+
description: A clear description of the feature you want to request.
15+
placeholder: "Describe the feature here..."
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
id: rationale
21+
attributes:
22+
label: Why this should be added
23+
description: Explain why this feature would be useful, and describe real use cases.
24+
placeholder: "Explain why this feature is important..."
25+
validations:
26+
required: true

Changelog.txt

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4074,10 +4074,27 @@ When setting a property like MORE to the a spell or skill defname, trying to rea
40744074

40754075
17-11-2025, Nolok
40764076
- Fixed: CAN_O_NOSLEEP was not considered/honored at server startup (Issue #1440).
4077-
- Changed: Object timers are now saved in worldsave files as TIMERMS, to avoid ambiguity and reliance on git build number to determine if TIMER expressed a number in seconds or milliseconds.
4077+
- Fixed: Chars not always going in sleeping state when appropriate (Issue #1249).
4078+
- Changed: Object timers are now saved in worldsave files as TIMERMS, to avoid ambiguity and reliance on git build number to
4079+
determine if TIMER expressed a number in seconds or milliseconds.
40784080
- Changed: Added 5 seconds timeout to DNS hostname resolution at startup (avoid getting stuck when connectivity is enabled but not working).
40794081
- Changed: CANMASK formatted in worldsave files as hexadecimal number, instead of decimal.
40804082

4081-
19-11-2025, Jhobean
4083+
2-12-2025, canerksk
4084+
- Changed: Duplicate message deleted. (Issue #1519).
4085+
4086+
3-12-2025, Nolok
4087+
- Fixed: Items were always put into 'sleeping' ticking state when moved inside a container (Issue #1272).
4088+
- Fixed: Failed assertion when a char speaks in a sector with a communication crystal and other items (Issue #1429).
4089+
- Fixed: "Old VarDef value..." log message being shown while resyncing a file even if the VarDef (DEF) didn't change (Issue #1437).
4090+
- Fixed: Str_To* methods (for string to number conversion) didn't correctly parse a single '0' if interpreting it as a hex number. This caused also 'mobtypes.txt' to not being parsed correctly.
4091+
- Added: SERV.MAP.n.SECTOR.n returns 1 if the sector number is valid, 0 otherwise.
4092+
- Added: Clear Console entry on taskbar icon of sphere console window on Windows OS (Issue - feature request #1516).
4093+
4094+
4-12-2025, Nolok
4095+
- Fixed: Malformed spell flags being returned via scripts.
4096+
- Fixed: REGION ISEVENT didn't (always?) find REGIONTYPES.
4097+
4098+
5-12-2025, Jhobean
40824099
- Fixed: Full Tooltip now update each time you move an item manually (Issue #1500)
40834100
- Fixed: On some situation when item was move or add on ground by script, decay flag and timer was not set. (Issue #1498)

cmake/toolchains/Windows-MSVC.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function(toolchain_after_project)
1313
if(NOT CMAKE_VS_PLATFORM_NAME)
1414
set(CMAKE_VS_PLATFORM_NAME "${CMAKE_VS_PLATFORM_NAME_DEFAULT}")
1515
endif()
16-
if(${CMAKE_VS_PLATFORM_NAME} STREQUAL "Win32")
16+
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
1717
set(CMAKE_SYSTEM_PROCESSOR "x86" CACHE INTERNAL "" FORCE)
1818
endif()
1919
set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_VS_PLATFORM_NAME}" CACHE INTERNAL "" FORCE)

src/common/CDataBase.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,14 @@ bool CDataBase::query(const char *query, CVarDefMap & mapQueryResult)
149149

150150
if ( !rownum )
151151
{
152-
mapQueryResult.SetStr(Str_FromI_Fast(i, key, sizeof(key), 10), true, z);
153-
mapQueryResult.SetStr(fields[i].name, true, z);
152+
mapQueryResult.SetStr(Str_FromI_Fast(i, key, sizeof(key), 10), true, z, false, true);
153+
mapQueryResult.SetStr(fields[i].name, true, z, false, true);
154154
}
155155

156156
snprintf(zStore, Str_TempLength(), "%d.%d", rownum, i);
157-
mapQueryResult.SetStr(zStore, true, z);
157+
mapQueryResult.SetStr(zStore, true, z, false, true);
158158
snprintf(zStore, Str_TempLength(), "%d.%s", rownum, fields[i].name);
159-
mapQueryResult.SetStr(zStore, true, z);
159+
mapQueryResult.SetStr(zStore, true, z, false, true);
160160
}
161161
++rownum;
162162
}

src/common/CVarDefMap.cpp

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -406,21 +406,24 @@ CVarDefContNum* CVarDefMap::SetNum( lpctstr pszName, int64 iVal, bool fDeleteZer
406406
return SetNumNew( pszName, iVal );
407407

408408
CVarDefContNum * pVarNum = dynamic_cast <CVarDefContNum *>( pVarBase );
409-
const bool fShouldWarn = fWarnOverwrite && g_Serv.IsStartupLoadingScripts();
410-
if ( pVarNum )
409+
const bool fResync = g_Serv.IsResyncing();
410+
bool fShouldWarn = fWarnOverwrite && g_Serv.IsStartupLoadingScripts();
411+
if ( pVarNum )
411412
{
413+
const int64 iOldVal = pVarNum->GetValNum();
414+
fShouldWarn = fShouldWarn || (fWarnOverwrite && fResync && (iVal != iOldVal));
412415
if ( fShouldWarn )
413416
{
414417
g_Log.EventWarn( "Replacing existing VarNum '%s' with number: 0%" PRIx64 " (%" PRId64 ")\n", pVarBase->GetKey(), iVal, iVal );
415418
#ifdef _DEBUG
416-
const int64 iOldVal = pVarNum->GetValNum();
417-
g_Log.EventDebug("Previous value: %0" PRIx64 "(%" PRId64 ")\n", iOldVal, iOldVal);
419+
g_Log.EventDebug("Previous value: 0%" PRIx64 " (%" PRId64 ")\n", iOldVal, iOldVal);
418420
#endif
419421
}
420422
pVarNum->SetValNum( iVal );
421423
}
422424
else
423425
{
426+
fShouldWarn = fShouldWarn || (fWarnOverwrite && fResync);
424427
if ( fShouldWarn )
425428
{
426429
g_Log.EventWarn( "Replacing existing VarStr '%s' with number: 0%" PRIx64" (%" PRId64 ")\n", pVarBase->GetKey(), iVal, iVal );
@@ -464,28 +467,28 @@ CVarDefContStr* CVarDefMap::SetStrOverride( lpctstr ptcKey, lpctstr pszVal )
464467
return SetStrNew(ptcKey,pszVal);
465468
}
466469

467-
CVarDefCont* CVarDefMap::SetStr( lpctstr pszName, bool fQuoted, lpctstr pszVal, bool fDeleteZero, bool fWarnOverwrite )
470+
CVarDefCont* CVarDefMap::SetStr( lpctstr pszName, bool fQuoted, lpctstr ptcVal, bool fDeleteZero, bool fWarnOverwrite )
468471
{
469472
ADDTOCALLSTACK_DEBUG("CVarDefMap::SetStr");
470473
// ASSUME: This has been clipped of unwanted beginning and trailing spaces.
471474
ASSERT(pszName);
472475
if ( !pszName[0] )
473476
return nullptr;
474477

475-
ASSERT(pszVal);
478+
ASSERT(ptcVal);
476479
if (!fQuoted)
477480
{
478-
if (pszVal[0] == '\0')
481+
if (ptcVal[0] == '\0')
479482
{
480483
// If Val is an empty string, remove any previous def (and do not add a new def)
481484
DeleteAtKey(pszName);
482485
return nullptr;
483486
}
484487

485-
if (IsSimpleNumberString(pszVal))
488+
if (IsSimpleNumberString(ptcVal))
486489
{
487490
// Just store the number and not the string.
488-
return SetNum(pszName, Exp_Get64Val(pszVal), fDeleteZero, fWarnOverwrite);
491+
return SetNum(pszName, Exp_Get64Val(ptcVal), fDeleteZero, fWarnOverwrite);
489492
}
490493
}
491494

@@ -496,32 +499,37 @@ CVarDefCont* CVarDefMap::SetStr( lpctstr pszName, bool fQuoted, lpctstr pszVal,
496499
pVarBase = m_Container[idx];
497500

498501
if ( !pVarBase )
499-
return SetStrNew( pszName, pszVal );
502+
return SetStrNew( pszName, ptcVal );
500503

501504
CVarDefContStr * pVarStr = dynamic_cast <CVarDefContStr *>( pVarBase );
502-
if ( pVarStr )
505+
const bool fResync = g_Serv.IsResyncing();
506+
bool fShouldWarn = fWarnOverwrite && g_Serv.IsStartupLoadingScripts();
507+
if ( pVarStr )
503508
{
504-
if ( fWarnOverwrite && !g_Serv.IsResyncing() && g_Serv.IsLoadingGeneric() )
509+
lpctstr ptcOldVal = pVarStr->GetValStr();
510+
fShouldWarn = fShouldWarn || (fWarnOverwrite && fResync && (0 != strncmp(ptcVal, ptcOldVal, SCRIPT_MAX_LINE_LEN)));
511+
if ( fShouldWarn )
505512
{
506-
g_Log.EventWarn( "Replacing existing VarStr '%s' with string: '%s'\n", pVarBase->GetKey(), pszVal );
513+
g_Log.EventWarn( "Replacing existing VarStr '%s' with string: '%s'\n", pVarBase->GetKey(), ptcVal );
507514
#ifdef _DEBUG
508-
g_Log.EventDebug("Previous value: '%s'\n", pVarStr->GetValStr());
515+
g_Log.EventDebug("Previous value: '%s'\n", ptcOldVal);
509516
#endif
510517
}
511-
pVarStr->SetValStr( pszVal );
518+
pVarStr->SetValStr( ptcVal );
512519
}
513520
else
514521
{
515-
if ( fWarnOverwrite && !g_Serv.IsResyncing() && g_Serv.IsLoadingGeneric() )
522+
fShouldWarn = fShouldWarn || (fWarnOverwrite && fResync);
523+
if ( fShouldWarn )
516524
{
517-
g_Log.EventWarn( "Replacing existing VarNum '%s' with string: '%s'\n", pVarBase->GetKey(), pszVal );
525+
g_Log.EventWarn( "Replacing existing VarNum '%s' with string: '%s'\n", pVarBase->GetKey(), ptcVal );
518526
#ifdef _DEBUG
519527
const int64 iOldVal = pVarStr->GetValNum();
520528
g_Log.EventDebug("Previous value: 0%" PRIx64 " (%" PRId64 ")\n", iOldVal, iOldVal);
521529

522530
#endif
523531
}
524-
return SetStrOverride( pszName, pszVal );
532+
return SetStrOverride( pszName, ptcVal );
525533
}
526534
return pVarStr;
527535
}

src/common/CVarDefMap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ class CVarDefMap
155155
lpctstr FindValStr( lpctstr pVal ) const;
156156

157157
CVarDefContNum* SetNumNew( lpctstr ptcKey, int64 iVal );
158-
CVarDefContNum* SetNum( lpctstr ptcKey, int64 iVal, bool fDeleteZero = true, bool fWarnOverwrite = true );
158+
CVarDefContNum* SetNum( lpctstr ptcKey, int64 iVal, bool fDeleteZero = true, bool fWarnOverwrite = false );
159159
CVarDefContNum* ModNum( lpctstr ptcKey, int64 iMod, bool fDeleteZero = true);
160160
CVarDefContStr* SetStrNew( lpctstr ptcKey, lpctstr pszVal );
161-
CVarDefCont* SetStr( lpctstr ptcKey, bool fQuoted, lpctstr pszVal, bool fDeleteZero = true, bool fWarnOverwrite = true );
161+
CVarDefCont* SetStr(lpctstr ptcKey, bool fQuoted, lpctstr ptcVal, bool fDeleteZero = true, bool fWarnOverwrite = false );
162162

163163
CVarDefCont * GetAt( size_t at ) const;
164164
CVarDefCont * GetKey( lpctstr ptcKey ) const;

src/common/resource/CResourceDef.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ bool CResourceDef::SetResourceName( lpctstr pszName )
6464
g_Log.EventWarn("DEFNAME=%s: redefinition (0%x!=0%x)\n",
6565
pszName, iKeyIndex, iResIndex);
6666

67-
pVarKeyNum = gwriter->m_VarResDefs.SetNum( pszName, dwResPrivateUID );
67+
pVarKeyNum = gwriter->m_VarResDefs.SetNum( pszName, dwResPrivateUID, false, true );
6868
}
6969
else
7070
{

src/common/resource/sections/CSpellDef.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ bool CSpellDef::r_WriteVal( lpctstr ptcKey, CSString & sVal, CTextConsole * pSrc
116116
sVal.FormatVal( m_idEffect );
117117
break;
118118
case SPC_FLAGS:
119-
sVal.FormatULLVal( m_uiFlags );
119+
sVal.FormatULLHex( m_uiFlags );
120120
break;
121121
case SPC_GROUP:
122122
sVal.FormatDWVal( m_dwGroup );

0 commit comments

Comments
 (0)