Commit 97d6c6ec3dc173114df4d9330e4f4ae94a5bc8f1

Authored by dg
1 parent 9aac7965

Bad shaders should not crash the engine, just not work


git-svn-id: http://svn.net-core.org/repos/t-engine4@913 51575b47-30f0-44d4-a5cc-537603b46e54
... ... @@ -175,6 +175,7 @@ newTalent{
175 175 return ([[Touch your foe and turn it into stone for %d turns.
176 176 Stoned creatures are unable to act or regen life and are very brittle.
177 177 If a stoned creature if hit by an attack that deals more than 30%% of its life it will shatter and be destroyed.
  178 + Stoned creatures are highly resistant to fire and lightning and somewhat resistant to physical attacks.
178 179 At level 3 it will become a beam.]]):format(math.floor((3 + self:getTalentLevel(t)) / 1.5))
179 180 end,
180 181 }
... ...
... ... @@ -130,10 +130,16 @@ newEffect{
130 130 on_lose = function(self, err) return "#Target# is not stoned anymore.", "-Stoned" end,
131 131 activate = function(self, eff)
132 132 eff.tmpid = self:addTemporaryValue("stoned", 1)
  133 + eff.resistsid = self:addTemporaryValue("resists", {
  134 + [DamageType.PHYSICAL]=20,
  135 + [DamageType.FIRE]=80,
  136 + [DamageType.LIGHTNING]=50,
  137 + })
133 138 eff.dur = self:updateEffectDuration(eff.dur, "stun")
134 139 end,
135 140 deactivate = function(self, eff)
136 141 self:removeTemporaryValue("stoned", eff.tmpid)
  142 + self:removeTemporaryValue("resists", eff.resistsid)
137 143 end,
138 144 }
139 145
... ...
... ... @@ -118,16 +118,16 @@ bool _CheckGLSLProgramValid(GLuint program)
118 118
119 119 #define CHECKGLSLCOMPILE( Shader, file ) \
120 120 if(!_CheckGLSLShaderCompile( Shader , file)) \
121   - exit(-1);
  121 + return(0);
122 122
123 123 #define CHECKGLSLLINK( Program ) \
124 124 if(!_CheckGLSLProgramLink( Program )) \
125   - exit(-1);
  125 + return(0);
126 126
127 127 #define CHECKGLSLVALID( Program ) \
128 128 glValidateProgramARB( Program ); \
129 129 if(!_CheckGLSLProgramValid( Program )) \
130   - exit(-1);
  130 + return(0);
131 131
132 132
133 133
... ...