1
0
mirror of synced 2024-11-23 23:21:06 +01:00

0.6.0.2 - Fix crash due to undefined mob, dancer, & runner

- Fix crash due to undefined mob, dancer, & runner
This commit is contained in:
Wei-Cheng Yeh (IID) 2024-10-27 22:35:31 +08:00 committed by GitHub
parent e9ca2c3996
commit 978dfc7bc7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ internal class CActImplDancer : CActivity {
var dancerOrigindir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.DANCER}");
if (Directory.Exists($@"{dancerOrigindir}")) {
var dirs = Directory.GetDirectories($@"{dancerOrigindir}");
if (preset.DancerSet.Length > 0 && preset.DancerSet != null) {
if (preset.DancerSet?.Length > 0) {
var _presetPath = (preset.DancerSet.Length > 0) ? $@"{dancerOrigindir}" + preset.DancerSet[random.Next(0, preset.DancerSet.Length)] : "";
var path = (Directory.Exists(_presetPath))
? _presetPath

View File

@ -20,7 +20,7 @@ internal class CActImplMob : CActivity {
Random random = new Random();
var upDirs = System.IO.Directory.GetDirectories(mobDir);
if (preset.MobSet.Length > 0 && preset.MobSet != null) {
if (preset.MobSet?.Length > 0) {
var _presetPath = (preset.MobSet.Length > 0) ? $@"{mobDir}" + preset.MobSet[random.Next(0, preset.MobSet.Length)] : "";
var path = Directory.Exists(_presetPath)
? _presetPath

View File

@ -62,7 +62,7 @@ internal class CActImplRunner : CActivity {
var dancerOrigindir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.RUNNER}");
if (Directory.Exists($@"{dancerOrigindir}")) {
var dirs = Directory.GetDirectories($@"{dancerOrigindir}");
if (preset.RunnerSet.Length > 0 && preset.RunnerSet != null) {
if (preset.RunnerSet?.Length > 0) {
var _presetPath = (preset.RunnerSet.Length > 0) ? $@"{dancerOrigindir}" + preset.RunnerSet[random.Next(0, preset.RunnerSet.Length)] : "";
var path = (Directory.Exists(_presetPath))
? _presetPath