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

Error with bodyless for loop #527

Closed
ike709 opened this issue Dec 10, 2021 · 3 comments
Closed

Error with bodyless for loop #527

ike709 opened this issue Dec 10, 2021 · 3 comments
Labels
Compiler Involves the OpenDream compiler

Comments

@ike709
Copy link
Collaborator

ike709 commented Dec 10, 2021

Code:

/obj/item/assembly/health/process()
	if(!scanning || !secured)
		return

	var/atom/A = src
	if(connected && connected.holder)
		A = connected.holder

	for(A, A && !ismob(A), A=A.loc);
	// like get_turf(), but for mobs.
	var/mob/living/M = A

	if(M)
		health_scan = M.health
		if(health_scan <= alarm_health)
			pulse()
			audible_message("[bicon(src)] *beep* *beep*")
			toggle_scan()
		return
	return

Error: Unknown identifier "M" at if(M)

Commenting out the for loop fixes it. Presumably bodyless for loops aren't being handled properly.

@wixoaGit wixoaGit added the Compiler Involves the OpenDream compiler label Dec 10, 2021
@ike709
Copy link
Collaborator Author

ike709 commented Dec 11, 2021

It's calling ProcStatement() which is pulling a following statement into the for body.

Needs an indentation check that it is actually part of the body.

@Just-a-Unity-Dev
Copy link

Close due to #414 fixing this?

@wixoaGit
Copy link
Member

Yes, it's fixed now

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

No branches or pull requests

3 participants