Comments (4)
It looks as though you are going beyond your defined array bounds when you are trying to access them via rand.Next
. As an example, in reforge.cs you have the definition
static int[] accessoryModifiers = { PrefixID.Warding, PrefixID.Menacing, PrefixID.Quick, PrefixID.Lucky, PrefixID.Arcane };
which has a length of 5. You then access it using
int index = rand.Next(0, accessoryModifiers.Length);
return accessoryModifiers[index];
which will return a value between 0-5 inclusive for a total of 6 options. As C# indexes arrays from 0, if you attempt to access the element at array.Length
then you are always going to be beyond the bounds of the array. in the given example, you want to change the call to rand.Next to
int index = rand.Next(0, accessoryModifiers.Length-1);
return accessoryModifiers[index];
This will need doing in all places where you are making references to arrays as any one of them could cause a crash.
from betterreforges.
I did what you said.
After further testing I found out that the Lightning Aura Rod (Summon) crashes when given a mythical modifier but not demonic modifier but the Flameburst Rod (Summon) can take either mythical or demonic modifier without crashing.
Every other damage type seems fine with no crashes.
from betterreforges.
It seems like the array.Length - 1 code you suggested had no effect on the crash and in fact just took away 1 from the actual array and never went out side bounds in the first place.
from betterreforges.
The mystical modifier seems to be like the only issue here so I replaced it with the demonic modifier and am no longer get any problems.
from betterreforges.
Related Issues (5)
- Modded Support
- Modifier Change HOT 1
- Reforge drills crashes the game HOT 1
- Mod is modifiying ammo? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from betterreforges.