Comments (3)
Note that if I change the code to the following it works
package basemod.patches.com.megacrit.cardcrawl.core.CardCrawlGame;
import com.evacipated.cardcrawl.modthespire.lib.ByRef;
import com.evacipated.cardcrawl.modthespire.lib.SpireInsertPatch;
import com.evacipated.cardcrawl.modthespire.lib.SpirePatch;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import basemod.BaseMod;
@SpirePatch(cls="com.megacrit.cardcrawl.core.CardCrawlGame", method="createCharacter")
public class CreateCharacterSwitch {
@SpireInsertPatch(loc=999, localvars={"p"})
public static void Insert(Object selectionObj, Object pObj) {
AbstractPlayer.PlayerClass selection = (AbstractPlayer.PlayerClass) selectionObj;
AbstractPlayer p = (AbstractPlayer) pObj;
if (!selection.toString().equals("IRONCLAD") && !selection.toString().equals("THE_SILENT") &&
!selection.toString().equals("CROWBOT")) {
p = BaseMod.createCharacter(selection.toString(), CardCrawlGame.playerName);
//pObj[0] = (Object) p;
}
}
}
from modthespire.
The issue is in the line src += info.localvars()[i] + " = __" + info.localvars()[i] + "[0];\n";
because it is trying to assign type Object to whatever type the localvar is without a type cast. A type cast is required to make this work. However, types cannot be obtained from local variables so the @ByRef annotation will need a field for allowing the modder to provide the fully qualified path of the type of the local variable
from modthespire.
Fixed in commit fbc476f
from modthespire.
Related Issues (20)
- Push a new release? HOT 1
- Crash with Downfall mod
- Log4j expoit HOT 1
- Breaks ultra wide support HOT 1
- MTS not starting
- onUseCard not being called with valid action HOT 1
- Black screen on Steam Deck HOT 2
- Permanent Black Screen due to Driver Crash due to Memory Leaks
- SteamDeck update Troble HOT 6
- [Suggestion] : Path the game only one time HOT 2
- Supporting newer Java versions HOT 1
- screen is tiny
- Critical Flaw in MTS Launcher HOT 1
- I have java 8 but still ''NoSuchMethodException'' HOT 4
- Update Kotlin Version
- SpirePatch: Replace. Unknown return object. HOT 1
- Crashing on Loading HOT 1
- Can it get a fastboot run?
- javaw.exe missing error HOT 1
- add ability to hide log panel while game is running
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 modthespire.