preferFunctionsDo not call Events for the same player inside an Events.connect callback. Use a Functions callback instead.small-rules/no-events-in-events-callbackDisallow sending Events back to the same player inside an Events.connect callback; use Functions for request/response.
Firing an Event back to the same player from inside its own .connect callback is a footgun. You’ll get
recursion or just confuse the request/response flow. Use a Functions callback for that – it’s the right
tool.
This tracks which players you’re sending Events to inside a callback and yells if you call Events for them
again from within. You point it at your Events import with eventsImportPaths – it doesn’t guess.
preferFunctionsDo not call Events for the same player inside an Events.connect callback. Use a Functions callback instead.This rule accepts one options object after the severity.
import { Events } from "server/networking";
Events.units.unequipUnit.connect((player: Player, unitKey: string): void => { if (unitKey.size() > 0) { Events.promptNotification.fire(player, "error"); }}); import { Events } from "server/networking";
Events.units.unequipUnit.connect((player: Player): void => { Events.promptNotification.fire(player, "error");});