Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting a course entry that doesn't exist causes an access violation #1497

Closed
RhythmLunatic opened this issue Jul 9, 2017 · 1 comment
Closed

Comments

@RhythmLunatic
Copy link
Contributor

RhythmLunatic commented Jul 9, 2017

This is inside ScreenSelectMusic underlay. Right when you select the next course (ScreenSelectCourse falls back on ScreenSelectMusic), it crashes.

The lua is inside a for loop. Substitute 'i' for any digit beyond the number of course entries you have.

LoadFont("TextBanner text")..{
	InitCommand=cmd(horizalign,left;settext,"test";addx,80;addy,-2;zoom,.75);
	CurrentCourseChangedMessageCommand=function(self)
		local course = GAMESTATE:GetCurrentCourse();
		if course then
			local song = course:GetCourseEntry(i):GetSong();
			if song then
				self:settext(song:GetDisplayMainTitle()); --The crash is triggered here, if you comment it out nothing happens
			end;
		end;
	end;
};
@RhythmLunatic RhythmLunatic changed the title Access Violation with font Access Violation with course? Jul 9, 2017
@RhythmLunatic RhythmLunatic changed the title Access Violation with course? Getting a course entry that doesn't exist causes an access violation Jul 9, 2017
@kyzentun
Copy link
Contributor

kyzentun commented Jul 9, 2017

Additional problem: Course does not have a function for getting the number of entries. Just GetCourseEntry for getting one entry, and GetCourseEntries for getting all of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants