View Issue Details

IDProjectCategoryView StatusLast Update
0009812New Feature Requests[All Projects] Generalpublic2018-01-29 21:01
ReporterCrosRoad95Assigned ToNecktrox 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Summary0009812: oopResource.getExportedFunctions() return exported functions from current resource
Description

oop of getResourceExportedFunctions ( Resource.getExportedFunctions ) require argument with resource.

for _,bbb in ipairs(getResources())do
  exportedFunctions = bbb.getExportedFunctions()
end

exportedFunctions is always functions from current resource

for _,bbb in ipairs(getResources())do
  a = bbb.getExportedFunctions() -- return wrong table
  b = bbb.getExportedFunctions(bbb) -- return correct table
  iprint(bbb, a,b) -- a != b
end
TagsNo tags attached.

Activities

Necktrox

2018-01-29 20:56

developer   ~~0026413

Last edited: 2018-01-29 21:00

View 2 revisions

bbb.getExportedFunctions(bbb)
bbb:getExportedFunctions()
getResourceExportedFunctions(bbb)
bbb.getExportedFunctions()
getResourceExportedFunctions()

That's Lua's syntax sugar. And getResourceExportedFunctions returns the exports of the current resource if you pass no arguments in. See: https://github.com/multitheftauto/mtasa-blue/blob/29160616d2cdea688ec6d649d9da33156cfee71a/Server/mods/deathmatch/logic/luadefs/CLuaResourceDefs.cpp#L1037-L1051

Issue History

Date Modified Username Field Change