Yielding from a coroutine seems to clear a local table
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start by reproducing the coroutine behavior with the Lua snippet in the issue, then inspect how the game embeds and resumes Lua coroutines. Compare the local table and other locals across the yield, and trace the resulting behavior to the reported mod error at MeleeHumanBehaviors.lua:1201. Done means explaining or fixing why PathDump becomes empty and confirming the reproduction no longer produces the reported error.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
I expected 5 to be printed a second time here, rather than it becoming 0.
I can't explain the fact that a and #b are still the correct value after the yield, though.
PRINT: 1. #PathDump is:
PRINT: 5
PRINT: 2. #PathDump is:
PRINT: 0
PRINT: a is:
PRINT: 1
PRINT: #b is:
PRINT: 1
since I can't think of a normal way in Lua for coroutine.yield() to alter the local PathDump
-- no waypoint list, create one in several small steps to reduce lag
local PathDump = {}
if Owner.MOMoveTarget and MovableMan:ValidMO(Owner.MOMoveTarget) then
Owner:DrawWaypoints(false)
-- copy the MovePath to a temporary table so we can yield safely while working on the path
for WptPos in Owner.MovePath do
print("Inserting WptPos:")
print(WptPos)
table.insert(PathDump, WptPos)
end
-- clear the path here so the graphical representation does not flicker on and off as much
Owner:ClearMovePath()
Owner:AddToMovePathEnd(Owner.MOMoveTarget.Pos)
else
coroutine.yield() -- wait until next frame
-- copy the MovePath to a temporary table so we can yield safely while working on the path
for WptPos in Owner.MovePath do
table.insert(PathDump, WptPos)
end
end
local a = 1
local b = {"c"}
print("1. #PathDump is:")
print(#PathDump)
coroutine.yield() -- wait until next frame
print("2. #PathDump is:")
print(#PathDump)
print("a is:")
print(a)
print("#b is:")
print(#b)
I am 99% sure the mod didn't have this issue in pre5, as my mod updater script would've noticed this error in the log back then, caused by PathDump being empty:
BoS Initiate GoToWpt error:
Mods/bos.rte/Actors/Soldiers/MeleeHumanBehaviors.lua:1201: attempt to index field 'Pos' (a nil value)
To Reproduce
- Download bos.rte.zip
- Download Benchmark.rte.zip
- Use this in your Settings.ini to instantly have the issue printed when the game boots:
LaunchIntoActivity = 1
DefaultActivityType = GAScripted
DefaultActivityName = Combat Benchmark
DefaultSceneName = Benchmark
- Lingua principale
- C++
- Stelle
- 329
- Fork
- 47
- Merge medio
- 6g 10h
- PR unite (30g)
- 14
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cortex-command-community/Cortex-Command-Community-Project
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
cortex-command-community/Cortex-Command-Community-Project#315 ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 87/100
cortex-command-community/Cortex-Command-Community-Project#301 ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 50/100
cortex-command-community/Cortex-Command-Community-Project#316 ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 57/100
cortex-command-community/Cortex-Command-Community-Project#314 ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
cortex-command-community/Cortex-Command-Community-Project#313 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di cortex-command-community/Cortex-Command-Community-Project
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement Ready for final check
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
mpogue2/SquareDesk#1818 · 1 commento ·
-
launch-client --save-creds creates creds/<account>/ with mode 755, not 700Forse già presa @metis-sprock l’ha presa oggi. Apertabacklog bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
EchoTools/nevr-runtime#1471 ·
I maintainer di solito rispondono entro 1 giorno
-
docs: Page not found?Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 66/100
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
iamankushpandit/Gume#231 ·
I maintainer di solito rispondono entro 1 giorno