TeamREPENTOGON / TeamREPENTOGON/REPENTOGON

Callbacks with Optional Param -1 run all callbacks

Open
#336 1 comment 0 reactions 1 assignee View on GitHub

@ConnorForan is already working on this.

Since Mar 14, 2024.

bug core
Dominant language
C++
Stars
345
Forks
51
Avg merge
11h 2m
Merged PRs (30d)
4

Description

Due to how vanilla callbacks logic works, callbacks that can feature -1 as a valid value in an optional parameter will run all callbacks on trigger. For example, in the case of items, tmtrainer items can be of id -1.
The main culprit is this:

local defaultCallbackMeta = {
	__matchParams = function(a, b)
		return not a or not b or a == -1 or b == -1 or a == b
	end
}

Which I assume may still be an issue in vanilla isaac althought I dont think there are any callbacks there that can have a -1 value.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.