Page MenuHomeFeedback Tracker

ActionBaseCB.OnFinish(bool pCanceled): pCanceled param does not work
Closed, ResolvedPublic

Description

Hello!
I was looking for a way to handle all player`s COMPLETED actions, so I choose ActionBaseCB and wrote the following code:

modded class ActionBaseCB {
    override void OnFinish(bool pCanceled) {
        Print("pCanceled: " + pCanceled);

        if (GetGame().IsServer() && !pCanceled) {
            // ... my code ...
        }

        super.OnFinish(pCanceled);
    }
}

Next, I choose ActionDigWorms to test it (with HuntingKnife).

Expected results:

  1. Started dig worms and finished it: pCanceled == true
  2. Started dig worms and cancelled it in the middle of process: pCanceled == false
  3. Started dig worms and cancelled it berfore process started: pCanceled == false

Actual results:

  1. Started dig worms and finished it: pCanceled == false
  2. Started dig worms and cancelled it in the middle of process: pCanceled == false
  3. Started dig worms and cancelled it berfore process started: pCanceled == false

Is it bug?

DayZ version: 1.19.155542

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
General

Event Timeline

xOk created this task.Jan 14 2023, 7:56 PM
xOk added a comment.Jan 14 2023, 8:02 PM

Found, that OnFinish(bool pCanceled) is defined at HumanCommandActionCallback, and there is a comment:

//! called ALWAYS! when action is finished (normal finish or cancel -> pCanceled)
	void 	OnFinish(bool pCanceled)	{};

Does it mean, that pCanceled is false at any case: normal finish or cancel?

xOk added a comment.Jan 14 2023, 8:20 PM
This comment was removed by xOk.
xOk added a comment.EditedJan 14 2023, 8:31 PM

Found, that OnFinish(bool pCanceled) is defined at HumanCommandActionCallback, and there is a comment:

//! called ALWAYS! when action is finished (normal finish or cancel -> pCanceled)
	void 	OnFinish(bool pCanceled)	{};

Does it mean, that pCanceled is false at any case: normal finish or cancel?

Seems like it is ture and it is not a bug, but feature.

Topic can be closed.

Geez closed this task as Resolved.Jan 16 2023, 9:57 AM
Geez claimed this task.