Make the trace functions properly match with the original game

This commit is contained in:
smallmodel committed 2025-06-08 23:48:17 +02:00
1 parent c350b7e9c4
commit ba3e68adc5
2 files changed
+62 -57

No files matched your search

+14 -11
View File
@@ -3899,7 +3899,7 @@ void ScriptThread::EventCreateListener(Event *ev)
void ScriptThread::EventTrace(Event *ev)
{
int content_mask = MASK_LINE;
int content_mask = MASK_SOLID;
Vector start;
Vector mins;
Vector maxs;
@@ -3916,12 +3916,12 @@ void ScriptThread::EventTrace(Event *ev)
mins = ev->GetVector(4);
case 3:
if (ev->GetInteger(3)) {
content_mask &= ~MASK_SCRIPT_SLAVE;
content_mask &= ~MASK_IGNORE_ENTS;
}
case 2:
end = ev->GetVector(2);
case 1:
start = ev->GetVector(1);
end = ev->GetVector(2);
break;
default:
throw ScriptException("Wrong number of arguments for trace.");
@@ -3935,11 +3935,12 @@ void ScriptThread::EventTrace(Event *ev)
void ScriptThread::EventSightTrace(Event *ev)
{
int content_mask = MASK_SOLID;
Vector start;
Vector mins;
Vector maxs;
Vector end;
int content_mask = MASK_SOLID;
Vector start;
Vector mins;
Vector maxs;
Vector end;
qboolean hit = qfalse;
mins = vec_zero;
maxs = vec_zero;
@@ -3954,16 +3955,16 @@ void ScriptThread::EventSightTrace(Event *ev)
content_mask &= ~MASK_IGNORE_ENTS;
}
case 2:
end = ev->GetVector(2);
case 1:
start = ev->GetVector(1);
end = ev->GetVector(2);
break;
default:
throw ScriptException("Wrong number of arguments for sighttrace.");
}
// call trace
ev->AddInteger(G_SightTrace(
hit = G_SightTrace(
start,
mins,
maxs,
@@ -3973,7 +3974,9 @@ void ScriptThread::EventSightTrace(Event *ev)
content_mask,
false,
"ScriptThread::EventSightTrace"
));
);
ev->AddInteger(hit);
}
void ScriptThread::EventPrint3D(Event *ev)