MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / UpdateScript

Method UpdateScript

neo/game/Actor.cpp:1332–1362  ·  view source on GitHub ↗

===================== idActor::UpdateScript ===================== */

Source from the content-addressed store, hash-verified

1330=====================
1331*/
1332void idActor::UpdateScript( void ) {
1333 int i;
1334
1335 if ( ai_debugScript.GetInteger() == entityNumber ) {
1336 scriptThread->EnableDebugInfo();
1337 } else {
1338 scriptThread->DisableDebugInfo();
1339 }
1340
1341 // a series of state changes can happen in a single frame.
1342 // this loop limits them in case we've entered an infinite loop.
1343 for( i = 0; i < 20; i++ ) {
1344 if ( idealState != state ) {
1345 SetState( idealState );
1346 }
1347
1348 // don't call script until it's done waiting
1349 if ( scriptThread->IsWaiting() ) {
1350 break;
1351 }
1352
1353 scriptThread->Execute();
1354 if ( idealState == state ) {
1355 break;
1356 }
1357 }
1358
1359 if ( i == 20 ) {
1360 scriptThread->Warning( "idActor::UpdateScript: exited loop to prevent lockup" );
1361 }
1362}
1363
1364/***********************************************************************
1365

Callers

nothing calls this directly

Calls 6

GetIntegerMethod · 0.80
EnableDebugInfoMethod · 0.45
DisableDebugInfoMethod · 0.45
IsWaitingMethod · 0.45
ExecuteMethod · 0.45
WarningMethod · 0.45

Tested by

no test coverage detected