mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-08-13 00:45:11 +09:00
Type the last of the forward declarations
Locals declared ahead of an assignment inside a callback were inferred as nil at every use site. The role event handlers are given a class so the table is not unified with the other module handler tables. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,10 @@ had, and event_handler expects `events` to be the handlers to register.
|
||||
local clusterio_api = require("modules/clusterio/api")
|
||||
local ExpRoles = require("modules/exp_roles/control")
|
||||
|
||||
return {
|
||||
--- @class ExpRoles.EventHandlers
|
||||
--- @field on_load fun()
|
||||
--- @field events table<defines.events, fun(event: EventData)>
|
||||
local handlers = {
|
||||
on_load = ExpRoles.on_load,
|
||||
events = {
|
||||
[clusterio_api.events.on_server_startup] = ExpRoles.on_server_startup,
|
||||
@@ -17,3 +20,5 @@ return {
|
||||
[defines.events.on_player_joined_game] = ExpRoles.on_player_joined_game,
|
||||
},
|
||||
}
|
||||
|
||||
return handlers
|
||||
|
||||
Reference in New Issue
Block a user