- split up zscript/shared/inventory.txt.

- moved health items to their own file.
- scriptified ScoreItem and MapRevealer whose entire functionality was a small TryPickup method.
- fixed: bit fields in global variables were not correctly written.

This should conclude the inventory cleanup. It is now possible again to find things in there.
This commit is contained in:
Christoph Oelckers 2016-11-30 13:36:13 +01:00
parent 229c55ce61
commit b0f3121bec
25 changed files with 982 additions and 959 deletions

View file

@ -2248,16 +2248,7 @@ FxExpression *FxAssign::Resolve(FCompileContext &ctx)
}
// Special case: Assignment to a bitfield.
if (Base->ExprType == EFX_StructMember || Base->ExprType == EFX_ClassMember)
{
auto f = static_cast<FxStructMember *>(Base)->membervar;
if (f->BitValue != -1 && !ctx.CheckReadOnly(f->Flags))
{
IsBitWrite = f->BitValue;
return this;
}
}
IsBitWrite = Base->GetBitValue();
return this;
}
@ -5743,6 +5734,11 @@ FxExpression *FxMemberIdentifier::Resolve(FCompileContext& ctx)
SAFE_RESOLVE(Object, ctx);
if (Identifier == FName("allmap"))
{
int a = 2;
}
// check for class or struct constants if the left side is a type name.
if (Object->ValueType == TypeError)
{

View file

@ -318,6 +318,7 @@ public:
virtual PPrototype *ReturnProto();
virtual VMFunction *GetDirectFunction();
virtual bool CheckReturn() { return false; }
virtual int GetBitValue() { return -1; }
bool IsNumeric() const { return ValueType->isNumeric(); }
bool IsFloat() const { return ValueType->GetRegType() == REGT_FLOAT && ValueType->GetRegCount() == 1; }
bool IsInteger() const { return ValueType->isNumeric() && (ValueType->GetRegType() == REGT_INT); }
@ -1266,6 +1267,7 @@ public:
FxExpression *Resolve(FCompileContext&);
bool RequestAddress(FCompileContext &ctx, bool *writable);
ExpEmit Emit(VMFunctionBuilder *build);
virtual int GetBitValue() { return membervar->BitValue; }
};
class FxCVar : public FxExpression
@ -1296,6 +1298,7 @@ public:
FxExpression *Resolve(FCompileContext&);
bool RequestAddress(FCompileContext &ctx, bool *writable);
ExpEmit Emit(VMFunctionBuilder *build);
virtual int GetBitValue() { return membervar->BitValue; }
};
//==========================================================================
@ -1349,6 +1352,7 @@ public:
FxExpression *Resolve(FCompileContext&);
bool RequestAddress(FCompileContext &ctx, bool *writable);
ExpEmit Emit(VMFunctionBuilder *build);
virtual int GetBitValue() { return membervar->BitValue; }
};
//==========================================================================

View file

@ -71,6 +71,8 @@
#include "a_weaponpiece.h"
#include "vmbuilder.h"
#include "a_ammo.h"
#include "a_health.h"
#include "a_keys.h"
extern TArray<PClassActor **> OptionalClassPtrs;