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

Method UpdateScript

neo/d3xp/Actor.cpp:1380–1410  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1378=====================
1379*/
1380void idActor::UpdateScript( void ) {
1381 int i;
1382
1383 if ( ai_debugScript.GetInteger() == entityNumber ) {
1384 scriptThread->EnableDebugInfo();
1385 } else {
1386 scriptThread->DisableDebugInfo();
1387 }
1388
1389 // a series of state changes can happen in a single frame.
1390 // this loop limits them in case we've entered an infinite loop.
1391 for( i = 0; i < 20; i++ ) {
1392 if ( idealState != state ) {
1393 SetState( idealState );
1394 }
1395
1396 // don't call script until it's done waiting
1397 if ( scriptThread->IsWaiting() ) {
1398 break;
1399 }
1400
1401 scriptThread->Execute();
1402 if ( idealState == state ) {
1403 break;
1404 }
1405 }
1406
1407 if ( i == 20 ) {
1408 scriptThread->Warning( "idActor::UpdateScript: exited loop to prevent lockup" );
1409 }
1410}
1411
1412/***********************************************************************
1413

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