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:
parent
e9ca2c3996
commit
978dfc7bc7
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user