self.Magazine is nil in Create()
Les mainteneurs répondent en général sous 2 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- C++
- Étoiles
- 329
- Forks
- 47
- Merge moyen
- 6 j 10 h
- PR mergées (30 j)
- 14
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de cortex-command-community/Cortex-Command-Community-Project
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
cortex-command-community/Cortex-Command-Community-Project#315 ·
Les mainteneurs répondent en général sous 2 jours
-
enhancement
Difficulté 1/5 Moins d'une heure Accessibilité débutants 87/100
cortex-command-community/Cortex-Command-Community-Project#301 ·
Les mainteneurs répondent en général sous 2 jours
-
bug
Difficulté 3/5 1-2 jours Accessibilité débutants 50/100
cortex-command-community/Cortex-Command-Community-Project#316 ·
Les mainteneurs répondent en général sous 2 jours
-
bug
Difficulté 3/5 1-2 jours Accessibilité débutants 57/100
cortex-command-community/Cortex-Command-Community-Project#314 ·
Les mainteneurs répondent en général sous 2 jours
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 55/100
cortex-command-community/Cortex-Command-Community-Project#313 ·
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de cortex-command-community/Cortex-Command-Community-Project
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
chipsalliance/verible#2644 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
grafana/pyroscope-dotnet#470 ·
Les mainteneurs répondent en général sous 1 jour
-
documentation P5 XS
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
open-astro/AlpacaBridge#1848 ·
Les mainteneurs répondent en général sous 1 jour
-
ai
Difficulté 1/5 Moins d'une heure Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 3 jours