MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ReleaseTarget

Method ReleaseTarget

scripts/AIGame3.cpp:4923–4942  ·  view source on GitHub ↗

Restores the target's movement

Source from the content-addressed store, hash-verified

4921
4922// Restores the target's movement
4923void Lifter::ReleaseTarget(int me) {
4924 // Make sure we still have a target
4925 if (memory->pull_target != OBJECT_HANDLE_NONE && qObjExists(memory->pull_target)) {
4926 // Check the type
4927 int type;
4928 Obj_Value(memory->pull_target, VF_GET, OBJV_I_TYPE, &type);
4929 if (type == OBJ_PLAYER) {
4930 aTogglePlayerObjControl(1, PLAYER_CONTROL_MASK, memory->pull_target);
4931 }
4932 }
4933
4934 // Release the pull target
4935 memory->pull_target = OBJECT_HANDLE_NONE;
4936
4937 // Set the next pull check time for a nice delay
4938 memory->next_pull_check_time =
4939 Game_GetTime() + LIFTER_NEXT_PULL_DELAY + (((float)rand() / (float)D3_RAND_MAX) * LIFTER_NEXT_PULL_VARIANCE);
4940
4941 mprintf(0, "Target released.\n");
4942}
4943
4944// Stops pulling and returns to hostile mode
4945void Lifter::StopPulling(int me) {

Callers

nothing calls this directly

Calls 3

qObjExistsFunction · 0.85
Obj_ValueFunction · 0.85
aTogglePlayerObjControlFunction · 0.85

Tested by

no test coverage detected