Skip to content

Commit

Permalink
me.charflags oog flags for hc and dead, extending getState from 159 t…
Browse files Browse the repository at this point in the history
…o 183
  • Loading branch information
bobode committed Feb 22, 2016
1 parent e8a4992 commit d509462
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion D2BS.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#define XP_WIN

#define D2BS_VERSION "1.5.1855" //uptodate with d branch 1765 ff 20b
#define D2BS_VERSION "1.5.1856" //uptodate with d branch 1765 ff 20b

#include <windows.h>
#include <vector>
Expand Down
6 changes: 5 additions & 1 deletion JSUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ JSAPI_PROP(unit_getProperty)
case ME_UNSUPPORTED:
vp.setBoolean(Vars.bEnableUnsupported);
break;
case ME_CHARFLAGS:
if(pData)
vp.setInt32(pData->nCharFlags);
break;
default:
break;
}
Expand Down Expand Up @@ -1176,7 +1180,7 @@ JSAPI_FUNC(unit_getState)
JS_EndRequest(cx);

// TODO: make these constants so we know what we're checking here
if(nState > 159 || nState < 0)
if(nState > 183 || nState < 0)
return JS_TRUE;

JS_SET_RVAL(cx, vp, BOOLEAN_TO_JSVAL(!!D2COMMON_GetUnitState(pUnit, nState)));
Expand Down
4 changes: 3 additions & 1 deletion JSUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ enum me_tinyid {
ME_PROFILE,
ME_NOPICKUP,
ME_PID,
ME_UNSUPPORTED
ME_UNSUPPORTED,
ME_CHARFLAGS
};

static JSPropertySpec me_props[] = {
Expand Down Expand Up @@ -145,6 +146,7 @@ static JSPropertySpec me_props[] = {
{"nopickup", ME_NOPICKUP, JSPROP_STATIC_VAR, JSOP_WRAPPER(unit_getProperty), JSOP_WRAPPER(unit_setProperty)},
{"pid", ME_PID, JSPROP_PERMANENT_VAR, JSOP_WRAPPER(unit_getProperty), JSOP_NULLWRAPPER },
{"unsupported", ME_UNSUPPORTED, JSPROP_PERMANENT_VAR, JSOP_WRAPPER(unit_getProperty), JSOP_NULLWRAPPER },
{"charflags", ME_CHARFLAGS, JSPROP_PERMANENT_VAR, JSOP_WRAPPER(unit_getProperty), JSOP_NULLWRAPPER },

{"screensize", OOG_SCREENSIZE, JSPROP_PERMANENT_VAR, JSOP_WRAPPER(unit_getProperty), JSOP_NULLWRAPPER },
{"windowtitle", OOG_WINDOWTITLE, JSPROP_PERMANENT_VAR, JSOP_WRAPPER(unit_getProperty), JSOP_NULLWRAPPER },
Expand Down

0 comments on commit d509462

Please sign in to comment.