From 5ca1c8243beae9fc662fcdd474f892977461161f Mon Sep 17 00:00:00 2001 From: Matei Date: Mon, 5 Feb 2007 02:42:24 +0000 Subject: [PATCH] Added a damage function to quasientities. This was SVN commit r4861. --- .../mods/official/scripts/entity_functions.js | 39 +------------------ 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/binaries/data/mods/official/scripts/entity_functions.js b/binaries/data/mods/official/scripts/entity_functions.js index b65cf94c3d..1f30e46405 100644 --- a/binaries/data/mods/official/scripts/entity_functions.js +++ b/binaries/data/mods/official/scripts/entity_functions.js @@ -363,44 +363,9 @@ function entityInitQuasi() } */ + this.damage = damage; + stopXTimer(7); - - /* - - // Profiling code for comparing performance of pure JavaScript objects vs. CJSComplex. - // This should be removed when we're done optimizing entity init. - - var ob = new Object(); - ob.traits = new Object(); - - for(var i=0; i<50; i++) { - ob["temp"+i] = "blah"; - } - for(var i=0; i<50; i++) { - ob.traits["temp"+i] = "blah"; - } - - ob.traits.id = new Object(); - ob.traits.id.civ = "hellenes"; - - startXTimer(9); - - // ~100 MS with ob = new Object() as above, ~400 MS with ob = this - if( ob.traits.id && ob.traits.id.civ ) - { - var id = ob.traits.id; - id.civ_code = id.civ.toString().substring (0, 4); - id.civ_code = id.civ_code.toString().toLowerCase(); - - // Exception to make the Romans into rome. - if (id.civ_code == "roma") id.civ_code = "rome"; - // Exception to make the Hellenes into hele. - if (id.civ_code == "hell") id.civ_code = "hele"; - } - - stopXTimer(9); - - */ } // ====================================================================