Blockland Forums > Modification Help
What does crash(); do
goz3rr:
--- Quote from: takato14 on July 10, 2010, 05:15:36 PM ---Guess no one will. x_x
--- End quote ---
Chuck norris knows it.
It probably divides something by zero.
otto-san:
--- Quote from: Headcrab Zombie on July 10, 2010, 02:56:40 PM ---ConsoleEntry::eval is the function used to run anything put in the console
Do trace(1); and then type anything, it will call ConsoleEntry::eval
--- End quote ---
well it crashed me
Headcrab Zombie:
--- Code: ---function ConsoleEntry::eval()
{
%text = ConsoleEntry.getValue();
echo("==>" @ %text);
eval(%text);
ConsoleEntry.setValue("");
}
--- End code ---
It crashes because it's creating an infinite loop, by evaling "ConsoleEntry::Eval();" before it clears what's in ConsoleEntry.
This is not what crash(); does, and it not what causes it to crash, just what happens when you manually call ConsoleEntry::Eval in the console
Try switching around those two lines, putting it in an add-on (Or just putting it all into one line and pasting it into console), and putting "ConsoleEntry::Eval()" in the console. It won't crash.
--- Code: ---function ConsoleEntry::eval()
{
%text = ConsoleEntry.getValue();
echo("==>" @ %text);
ConsoleEntry.setValue("");
eval(%text);
}
or
function ConsoleEntry::eval(){ %text = ConsoleEntry.getValue(); echo("==>" @ %text); ConsoleEntry.setValue(""); eval(%text); }
--- End code ---
takato14:
--- Quote from: goz3rr on July 11, 2010, 12:48:06 PM ---Chuck norris knows it.
It probably divides something by zero.
--- End quote ---
-_______________-
Olaf:
--- Quote from: Bauklotz on July 04, 2010, 02:53:10 AM ---My guess is that crash() imports some C libraries with syntax errors in them and stuff, and thus crashes when failing to import them.
--- End quote ---
Thanks :cookie: