diff --git a/desktop_version/src/Entity.cpp b/desktop_version/src/Entity.cpp index 256a882c..f1be30b5 100644 --- a/desktop_version/src/Entity.cpp +++ b/desktop_version/src/Entity.cpp @@ -770,7 +770,7 @@ void entityclass::generateswnwave( int t ) } } -void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*= 0*/ ) +void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*= 0*/, const std::string& script /*= ""*/ ) { k = blocks.size(); @@ -793,6 +793,7 @@ void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*= block.hp = h; block.rectset(xp, yp, w, h); block.trigger = trig; + block.script = script; break; case DAMAGE: //Damage block.type = DAMAGE; diff --git a/desktop_version/src/Entity.h b/desktop_version/src/Entity.h index 51c7499e..2cdb1b99 100644 --- a/desktop_version/src/Entity.h +++ b/desktop_version/src/Entity.h @@ -53,7 +53,7 @@ public: void generateswnwave(int t); - void createblock(int t, int xp, int yp, int w, int h, int trig = 0); + void createblock(int t, int xp, int yp, int w, int h, int trig = 0, const std::string& script = ""); bool removeentity(int t); diff --git a/desktop_version/src/Map.cpp b/desktop_version/src/Map.cpp index 9b04caf7..0cb8d431 100644 --- a/desktop_version/src/Map.cpp +++ b/desktop_version/src/Map.cpp @@ -1775,7 +1775,7 @@ void mapclass::loadlevel(int rx, int ry) case 19: //Script Box game.customscript[tempscriptbox]=edentity[edi].scriptname; obj.createblock(1, (edentity[edi].x*8)- ((rx-100)*40*8), (edentity[edi].y*8)- ((ry-100)*30*8), - edentity[edi].p1*8, edentity[edi].p2*8, 300+tempscriptbox); + edentity[edi].p1*8, edentity[edi].p2*8, 300+tempscriptbox, "custom_" + edentity[edi].scriptname); tempscriptbox++; break; case 50: //Warp Lines