Rework validation
This commit is contained in:
@@ -52,9 +52,9 @@ add_pack(struct rogue_state *rs,THING *obj, bool silent)
|
|||||||
|
|
||||||
if (pack == NULL)
|
if (pack == NULL)
|
||||||
{
|
{
|
||||||
pack = obj;
|
pack = obj;
|
||||||
obj->o_packch = pack_char();
|
obj->o_packch = pack_char();
|
||||||
inpack++;
|
inpack++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -291,11 +291,11 @@ inventory(struct rogue_state *rs,THING *list, int type)
|
|||||||
// fprintf(stderr,"n_objs.%d vs inpack.%d\n",n_objs,inpack), sleep(2);
|
// fprintf(stderr,"n_objs.%d vs inpack.%d\n",n_objs,inpack), sleep(2);
|
||||||
if (n_objs == 0)
|
if (n_objs == 0)
|
||||||
{
|
{
|
||||||
if (terse)
|
if (terse)
|
||||||
msg(rs,type == 0 ? (char *)"empty handed" : (char *)"nothing appropriate");
|
msg(rs,type == 0 ? (char *)"empty handed" : (char *)"nothing appropriate");
|
||||||
else
|
else
|
||||||
msg(rs,type == 0 ? (char *)"you are empty handed" : (char *)"you don't have anything appropriate");
|
msg(rs,type == 0 ? (char *)"you are empty handed" : (char *)"you don't have anything appropriate");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
end_line(rs);
|
end_line(rs);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|||||||
@@ -1226,16 +1226,21 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C
|
|||||||
if ( vopret.size() > 2 )
|
if ( vopret.size() > 2 )
|
||||||
{
|
{
|
||||||
script = (uint8_t *)vopret.data();
|
script = (uint8_t *)vopret.data();
|
||||||
if ( script[0] == EVAL_TOKENS )
|
funcid = script[1];
|
||||||
|
if ( (e= script[0]) == EVAL_TOKENS )
|
||||||
{
|
{
|
||||||
if ( script[1] == 'c' )
|
if ( script[1] == 'c' )
|
||||||
{
|
{
|
||||||
|
e = EVAL_ROGUE;
|
||||||
|
funcid = 'Q';
|
||||||
}
|
}
|
||||||
else if ( script[1] == 't' )
|
else if ( script[1] == 't' )
|
||||||
{
|
{
|
||||||
|
e = EVAL_ROGUE;
|
||||||
|
funcid = 'Q';
|
||||||
} else return eval->Invalid("illegal tokens funcid");
|
} else return eval->Invalid("illegal tokens funcid");
|
||||||
}
|
}
|
||||||
if ( script[0] == EVAL_ROGUE )
|
if ( e == EVAL_ROGUE )
|
||||||
{
|
{
|
||||||
switch ( funcid )
|
switch ( funcid )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user