self.Magazine is nil in Create()
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 with Data/Browncoats.rte/Devices/Weapons/Extinction/Extinction.lua and the reported Create() call that accesses self.Magazine; compare its fallback with the failing mod's INI magazine setup. Use the supplied mods and benchmark activity to reproduce the intermittent nil value at startup, then trace where the magazine is initialized. Done means the cause is identified and self.Magazine is reliably available when Create() uses it.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
self.Magazine can seemingly randomly be nil in Create()
Pawnis' recent Browncoat script even points it out with a comment, in Data/Browncoats.rte/Devices/Weapons/Extinction/Extinction.lua:
self.maxAmmoCount = self.Magazine and self.Magazine.Capacity or 5; -- loading a game might mess this up, so... fall-back
In the mod I found the issue, the error originates from here:
function Create(self)
self.ammoCounter = 100
self.recoil = 0
self.ff = false
print(self.Magazine)
self.f0 = ToMagazine(self.Magazine).RoundCount
self.f1 = ToMagazine(self.Magazine).RoundCount
self.firetimer = Timer()
end
I added the print(self.Magazine), and it shows that self.Magazine is nil a portion of the time it gets printed here.
Where the single ini file where it's used looks roughly like this:
AddAmmo = Magazine
PresetName = Magazine ChainChoppa
AddDevice = HDFirearm
PresetName = Chain Choppa
ScriptPath = orks.rte/Weapons/ChainChoppa/ChainChoppa.lua
Magazine = Magazine
CopyOf = Magazine ChainChoppa
To Reproduce
I haven't taken the time to make a Minimal Reproducible Example yet, but this should show the error after a minute or two of running:
- Download orks.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
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
scp-fs2open/fs2open.github.com#7953 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
SteveMacenski/slam_toolbox#907 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
HansKristian-Work/dxil-spirv#341 ·
I maintainer di solito rispondono entro 1 giorno