self.Magazine is nil in Create()
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- C++
- Estrelas
- 329
- Forks
- 47
- Merge médio
- 6d 10h
- PRs com merge (30d)
- 14
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de cortex-command-community/Cortex-Command-Community-Project
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
cortex-command-community/Cortex-Command-Community-Project#315 ·
Mantenedores costumam responder em até 2 dias
-
enhancement
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 87/100
cortex-command-community/Cortex-Command-Community-Project#301 ·
Mantenedores costumam responder em até 2 dias
-
bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 50/100
cortex-command-community/Cortex-Command-Community-Project#316 ·
Mantenedores costumam responder em até 2 dias
-
bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 57/100
cortex-command-community/Cortex-Command-Community-Project#314 ·
Mantenedores costumam responder em até 2 dias
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 55/100
cortex-command-community/Cortex-Command-Community-Project#313 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de cortex-command-community/Cortex-Command-Community-Project
Issues semelhantes
-
A-tools P-medium S-ready-to-start studio task
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
Status: Needs confirmation Status: Needs triage Type: Code Quality
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
Mantenedores costumam responder em até 1 dia
-
Image.resolveAssetSource's TypeScript declaration drops the null it returns for an unknown assetAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
react/react-native#59648 ·
Mantenedores costumam responder em até 2 dias
-
platform: Linux
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 80/100
keepassxreboot/keepassxc#13947 ·
Mantenedores costumam responder em até 1 dia
-
Shell: serve the home app's Cookie Policy on a hard reloadTalvez já em andamento @2001anshkaushik assumiu hoje. Abertafeature module:ai
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
rocketride-org/rocketride-server#2899 · 1 comentário ·
Mantenedores costumam responder em até 2 dias