mirror of
https://github.com/CPunch/gopenfusion.git
synced 2024-11-23 07:40:10 +00:00
shard: no longer panics if tdata/NPCs.json isn't found
This commit is contained in:
parent
0a28dbcc3e
commit
cd93a058ce
@ -18,7 +18,8 @@ func (server *ShardServer) LoadNPCs() {
|
|||||||
|
|
||||||
data, err := os.ReadFile(config.GetTDataPath() + "/NPCs.json")
|
data, err := os.ReadFile(config.GetTDataPath() + "/NPCs.json")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
log.Printf("Warning: failed to load NPCs: %v", err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// yes, we have to do it this way so our NPCs IDs will be incremented and unique
|
// yes, we have to do it this way so our NPCs IDs will be incremented and unique
|
||||||
|
Loading…
Reference in New Issue
Block a user