Does the game need this?

#1
In MouseLook function:

Code: Select all

;If 0 Then 
;fixing the black screen bug with some bubblegum code 
Local Zero# = 0.0
Local Nan1# = 0.0 / Zero
If Int(EntityX(Collider))=Int(Nan1) Then
	
	PositionEntity Collider, EntityX(Camera, True), EntityY(Camera, True) - 0.5, EntityZ(Camera, True), True
	Msg = "EntityX(Collider) = NaN, RESETTING COORDINATES    -    New coordinates: "+EntityX(Collider)
	MsgTimer = 300				
EndIf
;EndIf
It seems to be some code that resets the player's position if it's invalid, and displays a message. However, I haven't seen this message ingame. Removing the code doesn't seem to have any negative effect, so I'm not sure why Regalis added it.

Re: Does the game need this?

#2
It's to prevent a bug where people on 32-bit systems would get a bug where the camera spazzes out and they end up with a black screen.

Don't take that shit out or I will hurt you.
"now that the victim is in place, the killing bite will be administered in 10 seconds." --Valve.

Beware the man that speaks in hands.

☜☝☞☟ ✌

Re: Does the game need this?

#4
I haven't seen it since I don't have time to play much, But I know i have definitely seen it at least once.

Just leave it in there. For the love of god don't hurt it. It has a wife and kids. I love that code ;_;
"now that the victim is in place, the killing bite will be administered in 10 seconds." --Valve.

Beware the man that speaks in hands.

☜☝☞☟ ✌

Re: Does the game need this?

#5
I won't remove it, but maybe they is a better way to fix the black screen bug. I'll see if adding any debug stuff will help in making a better fix.

Edit:
https://www.mediafire.com/?5024jzrxe0q374a

For anyone that experienced the black screen bug with version v0.2, please download and play with this executable. Once the player's position becomes NaN (the NaN message appears, and you might have a lag spike), upload "bug_detect.txt" so I can see when things go wrong.