Skip to content

Commit bb0de60

Browse files
committed
fix crash with ghost misses
1 parent 219600d commit bb0de60

10 files changed

+45
-24
lines changed

source/Discord.hx

+4-1
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,12 @@ class DiscordClient
132132
songName = PlayState.SONG.song;
133133
modifierString = Highscore.getModeString(false, true);
134134
difficultyText = '${PlayState.instance.storyDifficultyText}${modifierString}';
135+
if (Options.instance.botplay) {
136+
difficultyText += " (Botplay)";
137+
}
135138
}
136139
var detailsText:String = PlayState.isStoryMode ? "Story Mode: Week " + PlayState.storyWeek : "Freeplay";
137-
var songText:String = songName + difficultyText;
140+
var songText:String = songName + " " + difficultyText;
138141
switch(type) {
139142
case "paused":
140143
changePresence("Paused - "+detailsText, songText, PlayState.instance.iconRPC);

source/HealthIcon.hx

+6-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ typedef SwagHealthIcon = {
2323
public var scale:Array<Float>;
2424
public var folderType:String;
2525
public var position_freeplay:Null<Array<Float>>;
26+
public var tileWidth:Null<Int>;
27+
public var tileHeight:Null<Int>;
2628
}
2729

2830
typedef SwagHealthIconItem = {
@@ -178,7 +180,10 @@ class HealthIcon extends FlxSprite
178180
loadGraphic(bitmap);
179181
var ratio = width / height;
180182
var intHeight = Math.floor(height);
181-
if (ratio > 2.5) {
183+
if (isJson && jsonData != null && jsonData.tileWidth != null) {
184+
//todo: load anims
185+
loadGraphic(bitmap, true, jsonData.tileWidth, jsonData.tileHeight == null ? intHeight : jsonData.tileHeight);
186+
} else if (ratio > 2.5) {
182187
loadGraphic(bitmap, true, Math.floor(width / 3), intHeight);
183188
animation.add('winning', [2], 0, false, isPlayer);
184189
animation.add('neutral', [0], 0, false, isPlayer);

source/Main.hx

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import Sys;
1818

1919
class Main extends Sprite
2020
{
21-
public static final gameVersionInt = 5;
22-
public static final gameVersionStr = "v1.1.3 I'm Guitarin' (& fix the modmenu)";
21+
public static final gameVersionInt = 6;
22+
public static final gameVersionStr = "v1.1.4 I'm Guitarin' (& fix the misses)";
2323

2424
var gameWidth:Int = 1280; // Width of the game in pixels (might be less / more in actual pixels depending on your zoom).
2525
var gameHeight:Int = 720; // Height of the game in pixels (might be less / more in actual pixels depending on your zoom).

source/Options.hx

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import lime.ui.ScanCode;
66
class Options {
77
public static var saved:Options;
88
public static var instance:Options;
9+
public static var playedVersion:Int = -1; //-1 when you've never played before
910

1011
public static var masterVolume:Float = 1;
1112
public var downScroll:Bool = false;
@@ -175,6 +176,7 @@ class Options {
175176
svd.data.playstate_guitar = playstate_guitar;
176177
svd.data.playstate_confusion = playstate_confusion;
177178

179+
svd.data.playedVersion = Main.gameVersionInt;
178180
svd.data.optionVersion = Std.int(0);
179181
svd.close();
180182
}

source/PlayState.hx

+18-14
Original file line numberDiff line numberDiff line change
@@ -2656,7 +2656,7 @@ class PlayState extends MusicBeatState
26562656
var validNote = note != null;
26572657
var noteTypeData = validNote ? note.getNoteTypeData() : Note.SwagNoteType.loadNoteType(Note.SwagNoteType.normalNote, PlayState.modName);
26582658

2659-
if (validNote && !noteTypeData.ignoreMiss) {
2659+
if ((validNote && !noteTypeData.ignoreMiss) || !validNote) {
26602660
health += noteTypeData.healthMiss;
26612661
if (combo > 5)
26622662
gf.playAvailableAnim(Options.instance.playstate_opponentmode ? ["sad_opponent", "sad"] : ["sad"]);
@@ -2671,15 +2671,17 @@ class PlayState extends MusicBeatState
26712671
if (Options.noteMissAction_MissSound[Options.instance.noteMissAction])
26722672
FlxG.sound.play(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.1, 0.2));
26732673

2674-
if (!note.isSustainNote)
2675-
songHittableMisses += 1;
2676-
2677-
if (noteTypeData.bob != 0 && noteTypeData.glitch)
2678-
bobBleeds.push({
2679-
timeLeft: 3,
2680-
mult: noteTypeData.bob * 1.5,
2681-
maxHealth: 2 * noteTypeData.healthMaxMult
2682-
});
2674+
if (validNote) {
2675+
if (!note.isSustainNote)
2676+
songHittableMisses += 1;
2677+
2678+
if (noteTypeData.bob != 0 && noteTypeData.glitch)
2679+
bobBleeds.push({
2680+
timeLeft: 3,
2681+
mult: noteTypeData.bob * 1.5,
2682+
maxHealth: 2 * noteTypeData.healthMaxMult
2683+
});
2684+
}
26832685
}
26842686
// FlxG.sound.play(Paths.sound('missnote1'), 1, false);
26852687
// FlxG.log.add('played imss note');
@@ -2805,7 +2807,9 @@ class PlayState extends MusicBeatState
28052807
}
28062808

28072809
function animateForNote(?note:Note, ?isBoyfriend:Bool = true, ?noteData:Int = 0, ?isMiss:Bool = false):Void {
2808-
if (note != null) {
2810+
//Note to editors: Check if the note EXISTS before doing anything with it
2811+
var validNote = note != null;
2812+
if (validNote) {
28092813
isBoyfriend = note.mustPress;
28102814
if (allowGameplayChanges) {
28112815
if (Options.instance.playstate_bothside)
@@ -2814,13 +2818,13 @@ class PlayState extends MusicBeatState
28142818
isBoyfriend = !isBoyfriend;
28152819
}
28162820
}
2817-
var noteTypeData = note != null ? note.getNoteTypeData() : Note.SwagNoteType.loadNoteType("Normal Note", modName);
2821+
var noteTypeData = validNote ? note.getNoteTypeData() : Note.SwagNoteType.loadNoteType("Normal Note", modName);
28182822
if (noteTypeData.noAnim)
28192823
return;
2820-
var char:Character = (note != null && note.charNum != -1) ? Character.activeArray[note.charNum] : (noteTypeData.charNums != null ? Character.activeArray[noteTypeData.charNums[0]] : (isBoyfriend ? boyfriend : dad));
2824+
var char:Character = (validNote && note.charNum != -1) ? Character.activeArray[note.charNum] : (noteTypeData.charNums != null ? Character.activeArray[noteTypeData.charNums[0]] : (isBoyfriend ? boyfriend : dad));
28212825
if (char == null)
28222826
return;
2823-
var color = (note.strumLineNum < 0 ? funnyManias[-2 - note.strumLineNum] : curManiaInfo).arrows[note == null ? noteData : note.noteData];
2827+
var color = validNote ? ((note.strumLineNum < 0 ? funnyManias[-2 - note.strumLineNum] : curManiaInfo).arrows[note.noteData]) : curManiaInfo.arrows[noteData];
28242828
var colorNote = "sing" + color.toUpperCase();
28252829
if (isMiss)
28262830
return char.playAvailableAnim(['${colorNote}miss', 'sing${ManiaInfo.Dir[color]}miss'], true);

source/PlayStateChangesSubState.hx

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class PlayStateChangesSubState extends OptionsSubStateBasic
3030
case "endless mode":
3131
return ["The song repeats forever! Freeplay Only", Options.saved.playstate_endless ? "Enabled" : "Disabled"];
3232
case "guitar mode":
33-
return ["Guitar Hero, basically. Hold the arrow key down and use square bracket keys to hit notes.", Options.saved.playstate_guitar ? "Enabled" : "Disabled"];
33+
return ["Guitar Hero, basically. Hold the arrow key down and use Guitar Strum keybind to hit notes.", Options.saved.playstate_guitar ? "Enabled" : "Disabled"];
3434
case "confusion":
3535
return ["Notes may sometimes appear visually in wrong lanes.", Options.saved.playstate_confusion ? "Enabled" : "Disabled"];
3636
case "clear gameplay changes":

sourceUpdater/Main.hx

+5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ class Main extends Sprite
4343
"songs"
4444
];
4545

46+
var dontCopyGameContent:Array<String> = [
47+
"mods/modList.txt", //this file shouldn't exist in distributed versions but if it DOES....!!!
48+
"vmanengineupdater.exe" //would be moved in by the game.
49+
];
50+
4651
public static function main():Void
4752
{
4853
#if (debug && !html5)

version/vman_engine.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
5
2-
1.1.3
1+
6
2+
1.1.4

version/vman_engine_changelog.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Fixed crashes related to modList.txt and mods menu
2-
Also removed modList.txt from distributed build
3-
and added the (optional) ability to antialias stuff in mod menu
1+
Botplay now visible in discord
2+
Fixed an antimash crash fix (specifically, when you miss without an associated note)
3+
Clarified something in the Guitar Mode option description
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Botplay now visible in discord
2+
Fixed an antimash crash fix (specifically, when you miss without an associated note)

0 commit comments

Comments
 (0)