Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions engine/source/scriptlib/Parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1834,17 +1834,21 @@ void Parser_Unary_expr(Parser *pparser )
{
Parser_Match(pparser);
Parser_Unary_expr(pparser );
pInstruction = (Instruction *)List_Retrieve(pparser->pIList);
if(pInstruction->OpCode == CONSTINT)
{
int constvar = ~(atoi(pInstruction->theToken->theSource));
sprintf(buf, "%d", constvar);
strcpy(pInstruction->theToken->theSource, buf);
}
else
{
Parser_AddInstructionViaToken(pparser, BIT_NOT, (Token *)NULL, NULL );
}

/*
* Caskey, Damon V.
* 2026-06-08
*
* Do not constant-fold bitwise NOT here.
* The legacy atoi()/int fold truncates
* 64-bit integer constants before they can
* reach the ScriptVariant operator path.
*
* Emit BIT_NOT so runtime handling preserves
* VT_INTEGER, VT_INTEGER64, and VT_UINTEGER64
* carrier semantics.
*/
Parser_AddInstructionViaToken(pparser, BIT_NOT, (Token *)NULL, NULL );
}
else
{
Expand Down
20 changes: 20 additions & 0 deletions engine/version.tmp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* OpenBOR - http://www.ChronoCrash.com
* -----------------------------------------------------------------------
* All rights reserved, see LICENSE in OpenBOR root for details.
*
* Copyright (c) OpenBOR Team
*/

#ifndef VERSION_H
#define VERSION_H

#define VERSION_NAME "OpenBOR"
#define VERSION_MAJOR "4"
#define VERSION_MINOR "0"
#define VERSION_BUILD "7779"
#define VERSION_BUILD_INT 7779
#define VERSION_COMMIT "fa1c220"
#define VERSION "v"VERSION_MAJOR"."VERSION_MINOR" Build "VERSION_BUILD" (commit hash: "VERSION_COMMIT")"

#endif
Loading