Fixed x64 script/class connections and added material flags that are needed.

This commit is contained in:
Justin Marshall
2026-05-05 16:20:05 -07:00
parent 8d5f678b25
commit d06356e042
12 changed files with 2437 additions and 2202 deletions
+26 -7
View File
@@ -672,7 +672,9 @@ void idInterpreter::CallEvent( const function_t *func, int argsize ) {
varEval_t var;
int pos;
int start;
int data[ D_EVENT_MAXARGS ];
// RB: 64 bit fixes, changed int to intptr_t
intptr_t data[D_EVENT_MAXARGS];
// RB end
const idEventDef *evdef;
const char *format;
@@ -686,6 +688,9 @@ void idInterpreter::CallEvent( const function_t *func, int argsize ) {
start = localstackUsed - argsize;
var.intPtr = ( int * )&localstack[ start ];
eventEntity = GetEntity( *var.entityNumberPtr );
static int testme;
testme = *var.entityNumberPtr;
if ( !eventEntity || !eventEntity->RespondsTo( *evdef ) ) {
if ( eventEntity && developer.GetBool() ) {
@@ -703,10 +708,11 @@ void idInterpreter::CallEvent( const function_t *func, int argsize ) {
// always return a safe value when an object doesn't exist
switch( evdef->GetReturnType() ) {
case D_EVENT_INTEGER :
gameLocal.program.ReturnInteger( 0 );
case D_EVENT_INTEGER:
gameLocal.program.ReturnInteger(0);
break;
case D_EVENT_FLOAT :
gameLocal.program.ReturnFloat( 0 );
break;
@@ -739,13 +745,18 @@ void idInterpreter::CallEvent( const function_t *func, int argsize ) {
for( j = 0, i = 0, pos = type_object.Size(); ( pos < argsize ) || ( format[ i ] != 0 ); i++ ) {
switch( format[ i ] ) {
case D_EVENT_INTEGER :
var.intPtr = ( int * )&localstack[ start + pos ];
data[ i ] = int( *var.floatPtr );
var.intPtr = (int*)&localstack[start + pos];
// RB: fixed data alignment
//data[ i ] = int( *var.floatPtr );
(*(int*)&data[i]) = int(*var.floatPtr);
// RB end
break;
case D_EVENT_FLOAT :
var.intPtr = ( int * )&localstack[ start + pos ];
( *( float * )&data[ i ] ) = *var.floatPtr;
static float value;
value = (*(float*)&data[i]);
break;
case D_EVENT_VECTOR :
@@ -869,7 +880,9 @@ void idInterpreter::CallSysEvent( const function_t *func, int argsize ) {
varEval_t source;
int pos;
int start;
int data[ D_EVENT_MAXARGS ];
// RB: 64 bit fixes, changed int to intptr_t
intptr_t data[D_EVENT_MAXARGS];
// RB end
const idEventDef *evdef;
const char *format;
@@ -1988,10 +2001,15 @@ bool idInterpreter::Execute( void ) {
break;
case OP_PUSH_V:
var_a = GetVariable( st->a );
var_a = GetVariable(st->a);
// RB: 64 bit fix, changed individual pushes with PushVector
/*
Push( *reinterpret_cast<int *>( &var_a.vectorPtr->x ) );
Push( *reinterpret_cast<int *>( &var_a.vectorPtr->y ) );
Push( *reinterpret_cast<int *>( &var_a.vectorPtr->z ) );
*/
PushVector(*var_a.vectorPtr);
// RB end
break;
case OP_PUSH_OBJ:
@@ -2014,3 +2032,4 @@ bool idInterpreter::Execute( void ) {
return threadDying;
}