From 972af0b0cbe1e67470d6a520233dd1f58f8ae02c Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 26 Apr 2015 12:34:42 -0300 Subject: [PATCH] -Fixed shader commets, /* */ works well and crash is solved, fixes #1711 --- servers/visual/shader_language.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 5dd2c2e0be0..9b1b61dcef6 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -118,13 +118,17 @@ ShaderLanguage::Token ShaderLanguage::read_token(const CharType* p_text,int p_le while(true) { - if (GETCHAR(r_chars+1)=='0') + if (GETCHAR(r_chars+1)==0) { + r_chars+=1; break; - if (GETCHAR(r_chars+1)=='*' && GETCHAR(r_chars+2)=='/') + } if (GETCHAR(r_chars+1)=='*' && GETCHAR(r_chars+2)=='/') { + r_chars+=3; break; - if (GETCHAR(r_chars+1)=='\n') + } if (GETCHAR(r_chars+1)=='\n') { r_line++; - r_chars++; + } + + r_chars++; } return Token();