Skip to content

Conversation

@TFSMads
Copy link
Contributor

@TFSMads TFSMads commented Oct 22, 2025

Problem

Teleport effect is causing set damage not to work as expected as described in #8203

Solution

Removed teleport effect setting hasDelayBefore to Unkown.

Testing Completed

Tested on version 1.21.10

Supporting Information


Completes: #8203
Related: none

@TFSMads TFSMads requested a review from a team as a code owner October 22, 2025 16:12
@TFSMads TFSMads requested review from Pesekjak and TheMug06 and removed request for a team October 22, 2025 16:12
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Oct 22, 2025
Copy link
Member

@Efnilite Efnilite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be fixed by only setting the delay before of the if branch

@sovdeeth
Copy link
Member

The teleport effect is working fine, do not remove its setting of the delay.

The issue is in the prolongation of delays through the parsing of the if. The parser should be smart enough to realize that the delayed path stops and only non-delayed paths reach the set damage effect.

@TFSMads TFSMads requested a review from a team as a code owner October 22, 2025 22:17
@TFSMads TFSMads requested review from UnderscoreTud and removed request for a team October 22, 2025 22:17
@TFSMads TFSMads changed the title Fix EvtTeleport setting hasDelay Fixed so that delays on a blind path doesn't affect other paths Oct 22, 2025
@TFSMads
Copy link
Contributor Author

TFSMads commented Oct 22, 2025

on damage of player:
    if world of victim is "world":
        wait 1 tick
    if damage cause is fall:
        stop    
    set damage to 0
    #HasDelay is not chaged - 

 
on damage of player:
    wait 1 tick
    if damage cause is fall:
        stop    
    set damage to 0
    #HasDelay is not chaged
 

on damage of player:
    if world of victim is "world":
        wait 1 tick
        stop    
    set damage to 0
    #HasDelay is set to false

on damage of player:
    if world of victim is "world":
        if damage cause is fall:
            wait 1 tick
        stop    
    set damage to 0
    #HasDelay is set to false
image

I have tested the changes on version 1.21.10 with the script above. Delays from paths where set damage is unreachable is ignored while delay from paths that can reach 'set damage' remains.


if (async)
getParser().setHasDelayBefore(Kleenean.UNKNOWN); // UNKNOWN because it isn't async if the chunk is already loaded.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

if (getParser().getCurrentSection(TriggerSection.class) instanceof Section currentSection
&& currentSection.getNode() instanceof SectionNode currentNode) {

// set hasDelay to false if the only delayed section is the current one
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this safe in the following scenario? I don't think it is

loop 3 times:
    wait 1 tick # the loop is delayed
    exit loop # only this section is delayed, so we set delayed before to false
set damage to 2 # setting damage after event has passed

@skriptlang-automation skriptlang-automation bot removed the needs reviews A PR that needs additional reviews label Oct 23, 2025
@sovdeeth sovdeeth added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Oct 23, 2025
@sovdeeth sovdeeth moved this to In Review in 2.13 Releases Oct 23, 2025
@sovdeeth sovdeeth linked an issue Oct 23, 2025 that may be closed by this pull request
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug An issue that needs to be fixed. Alternatively, a PR fixing an issue.

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

Can't change the damage anymore after the event has already passed

3 participants