Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: JSGame.cpp
- ===================================================================
- --- JSGame.cpp (revision 1149)
- +++ JSGame.cpp (working copy)
- @@ -184,18 +184,28 @@
- JSObject* lvl = NULL;
- uint x = 0, y = 0, dx = 0, dy = 0, reductionType = 0, radius = 20;
- - if(!JS_ConvertArguments(cx, argc, argv, "ouuuu/uu", &lvl, &x, &y, &dx, &dy, &reductionType, &radius))
- + if(!JS_ConvertArguments(cx, argc, argv, "uuuuu/uu", &lvl, &x, &y, &dx, &dy, &reductionType, &radius))
- return JS_FALSE;
- + Level* level;
- + if (!(JSVAL_IS_OBJECT(argv[0]))){
- + level = GetLevel(JSVAL_TO_INT(argv[0]));
- + }else{
- + myArea* area = (myArea*)JS_GetPrivate(cx, lvl);
- + if(!area)
- + THROW_ERROR(cx, "Could not retrieve area data!");
- + level = GetLevel(area->AreaId);
- + }
- + if (JSVAL_IS_BOOLEAN(argv[5])){
- + if(JSVAL_TO_BOOLEAN(argv[5]))
- + reductionType = 2;
- + else
- + reductionType = 1;
- + }
- if(reductionType == 3 && !(JSVAL_IS_FUNCTION(cx, argv[7]) && JSVAL_IS_FUNCTION(cx, argv[8])))
- THROW_ERROR(cx, "Invalid function values for reduction type");
- - myArea* area = (myArea*)JS_GetPrivate(cx, lvl);
- - if(!area)
- - THROW_ERROR(cx, "Could not retrieve area data!");
- - Level* level = GetLevel(area->AreaId);
- -
- D2Map map(level->pMisc->pAct, level);
- Point start(x, y), end(dx, dy);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement