Skip to content

Commit

Permalink
Merge branch 'master' into redo-noms
Browse files Browse the repository at this point in the history
  • Loading branch information
dvander committed Jul 7, 2014
2 parents a7de88d + af557fd commit 8e59926
Show file tree
Hide file tree
Showing 15 changed files with 716 additions and 399 deletions.
4 changes: 3 additions & 1 deletion AMBuildScript
Expand Up @@ -73,7 +73,9 @@ class SMConfig(object):
self.versionlib = None

def use_auto_versioning(self):
return builder.backend == 'amb2' and not builder.options.disable_auto_versioning
if builder.backend != 'amb2':
return False
return not getattr(builder.options, 'disable_auto_versioning', False)

@property
def tag(self):
Expand Down
6 changes: 6 additions & 0 deletions core/HalfLife2.cpp
Expand Up @@ -1170,6 +1170,12 @@ const char *CHalfLife2::GetEntityClassname(CBaseEntity *pEntity)
if (offset == -1)
{
CBaseEntity *pGetterEnt = ReferenceToEntity(0);
if (pGetterEnt == NULL)
{
// If we don't have a world entity yet, we'll have to rely on the given entity
pGetterEnt = pEntity;
}

datamap_t *pMap = GetDataMap(pGetterEnt);

sm_datatable_info_t info;
Expand Down
2 changes: 1 addition & 1 deletion plugins/include/adt_array.inc
Expand Up @@ -301,7 +301,7 @@ methodmap ArrayList < Handle {
public SwapAt() = SwapArrayItems;
public FindString() = FindStringInArray;
public FindValue() = FindValueInArray;
property int Size {
property int Length {
public get() = GetArraySize;
}
};
2 changes: 1 addition & 1 deletion plugins/include/handles.inc
Expand Up @@ -78,7 +78,7 @@ native Handle:CloneHandle(Handle:hndl, Handle:plugin=INVALID_HANDLE);
/**
* Helper for object-oriented syntax.
*/
methodmap Handle
methodmap Handle __nullable__
{
public Clone() = CloneHandle;
public ~Handle() = CloseHandle;
Expand Down
2 changes: 1 addition & 1 deletion plugins/include/mapchooser.inc
Expand Up @@ -98,7 +98,7 @@ native bool:EndOfMapVoteEnabled();
* Called when mapchooser removes a nomination from its list.
* Nominations cleared on map start will not trigger this forward
*/
forward void OnNominationRemoved(char[] map, int owner);
forward void OnNominationRemoved(const char[] map, int owner);

/**
* Called when mapchooser starts a Map Vote.
Expand Down
30 changes: 14 additions & 16 deletions plugins/include/menus.inc
Expand Up @@ -453,7 +453,7 @@ native GetMenuOptionFlags(Handle:menu);
* @noreturn
* @error Invalid Handle.
*/
native SetMenuOptionFlags(Handle:menu, flags);
native void SetMenuOptionFlags(Handle:menu, flags);

/**
* Returns whether a vote is in progress.
Expand Down Expand Up @@ -562,24 +562,29 @@ methodmap Menu < Handle {
public DisplayVote() = VoteMenu;
public DisplayVoteToAll() = VoteMenuToAll;

public SetPagination() = SetMenuPagination;
property int Pagination {
public get() = GetMenuPagination;
public set(int value) {
SetMenuPagination(this, value);
}
}

public SetOptionFlags() = SetMenuOptionFlags;
property int OptionFlags {
public get() = GetMenuOptionFlags;
public set() = SetMenuOptionFlags;
}

public SetExitButton() = SetMenuExitButton;
property bool ExitButton {
public get() = GetMenuExitButton;
public set(bool value) {
SetMenuExitButton(this, value);
}
}
public SetExitBackButton() = SetMenuExitBackButton;
property bool ExitBackButton {
public get() = GetMenuExitBackButton;
public set(bool value) {
SetMenuExitBackButton(this, value);
}
}

public SetNoVoteButton() = SetMenuNoVoteButton;
public SetVoteResultCallback() = SetVoteResultCallback;

Expand All @@ -589,18 +594,11 @@ methodmap Menu < Handle {
property Handle Style {
public get() = GetMenuStyle;
}
property bool VoteInProgress {
property int SelectionPosition {
public get() {
return IsVoteInProgress(this);
return GetMenuSelectionPosition();
}
}

public void CancelVote() {
CancelVote();
}
public int GetSelectionPosition() {
return GetMenuSelectionPosition();
}
};

/**
Expand Down
4 changes: 2 additions & 2 deletions plugins/include/tf2.inc
Expand Up @@ -254,12 +254,12 @@ native TF2_SetPlayerPowerPlay(client, bool:enabled);
*
* @param client Player's index.
* @param team Team to disguise the player as (only TFTeam_Red and TFTeam_Blue have an effect)
* @param class TFClassType class to disguise the player as
* @param classType TFClassType class to disguise the player as
* @param target Specific target player to disguise as (0 for any)
* @noreturn
* @error Invalid client index, client not in game, or no mod support.
*/
native TF2_DisguisePlayer(client, TFTeam:team, TFClassType:class, target=0);
native TF2_DisguisePlayer(client, TFTeam:team, TFClassType:classType, target=0);

/**
* Removes the current disguise from a client. Only has an effect on spies.
Expand Down
8 changes: 4 additions & 4 deletions plugins/include/tf2_stocks.inc
Expand Up @@ -335,19 +335,19 @@ stock TFClassType:TF2_GetPlayerClass(client)
* Note: If setting player class in a player spawn hook weapons should be set to false.
*
* @param client Player's index.
* @param class TFClassType class symbol.
* @param classType TFClassType class symbol.
* @param weapons This paramater is ignored.
* @param persistent If true changes the players desired class so the change stays after death.
* @noreturn
* @error Invalid client index.
*/
stock TF2_SetPlayerClass(client, TFClassType:class, bool:weapons=true, bool:persistent=true)
stock TF2_SetPlayerClass(client, TFClassType:classType, bool:weapons=true, bool:persistent=true)
{
SetEntProp(client, Prop_Send, "m_iClass", _:class);
SetEntProp(client, Prop_Send, "m_iClass", _:classType);

if (persistent)
{
SetEntProp(client, Prop_Send, "m_iDesiredPlayerClass", _:class);
SetEntProp(client, Prop_Send, "m_iDesiredPlayerClass", _:classType);
}
}

Expand Down
15 changes: 15 additions & 0 deletions sourcepawn/compiler/sc.h
Expand Up @@ -171,6 +171,7 @@ typedef struct s_symbol {
#define iREFFUNC 10
#define iVARARGS 11 /* function specified ... as argument(s) */
#define iPROXY 12 /* proxies to another symbol. */
#define iACCESSOR 13 /* property accessor via a methodmap_method_t */

/* Possible entries for "usage"
*
Expand Down Expand Up @@ -240,6 +241,8 @@ typedef struct s_symbol {

#define sSTATEVAR 3 /* criterion to find variables (sSTATEVAR implies a global variable) */

struct methodmap_method_s;

typedef struct value_s {
symbol *sym; /* symbol in symbol table, NULL for (constant) expression */
cell constval; /* value of the constant expression (if ident==iCONSTEXPR)
Expand All @@ -250,6 +253,9 @@ typedef struct value_s {
* iEXPRESSION or iREFERENCE */
char boolresult; /* boolean result for relational operators */
cell *arrayidx; /* last used array indices, for checking self assignment */

/* when ident == iACCESSOR */
struct methodmap_method_s *accessor;
} value;

/* Wrapper around value + l/rvalue bit. */
Expand Down Expand Up @@ -411,6 +417,8 @@ enum {
tMETHODMAP,
tNATIVE,
tNEW,
tNULL,
tNULLABLE,
tOBJECT,
tOPERATOR,
tPUBLIC,
Expand Down Expand Up @@ -675,6 +683,7 @@ SC_FUNC cell array_totalsize(symbol *sym);
SC_FUNC int matchtag_string(int ident, int tag);
SC_FUNC int checktag_string(value *sym1, value *sym2);
SC_FUNC int checktags_string(int tags[], int numtags, value *sym1);
SC_FUNC int lvalexpr(svalue *sval);

/* function prototypes in SC4.C */
SC_FUNC void writeleader(symbol *root);
Expand All @@ -699,6 +708,7 @@ SC_FUNC void copyarray(symbol *sym,cell size);
SC_FUNC void fillarray(symbol *sym,cell size,cell value);
SC_FUNC void ldconst(cell val,regid reg);
SC_FUNC void moveto1(void);
SC_FUNC void move_alt(void);
SC_FUNC void pushreg(regid reg);
SC_FUNC void pushval(cell val);
SC_FUNC void popreg(regid reg);
Expand Down Expand Up @@ -726,6 +736,10 @@ SC_FUNC void charalign(void);
SC_FUNC void addconst(cell value);
SC_FUNC void setheap_save(cell value);
SC_FUNC void stradjust(regid reg);
SC_FUNC void invoke_getter(struct methodmap_method_s *method);
SC_FUNC void invoke_setter(struct methodmap_method_s *method, int save);
SC_FUNC void inc_pri();
SC_FUNC void dec_pri();

/* Code generation functions for arithmetic operators.
*
Expand Down Expand Up @@ -923,6 +937,7 @@ SC_VDECL int pc_tag_string; /* global String tag */
SC_VDECL int pc_tag_void; /* global void tag */
SC_VDECL int pc_tag_object; /* root object tag */
SC_VDECL int pc_tag_bool; /* global bool tag */
SC_VDECL int pc_tag_null_t; /* the null type */
SC_VDECL int pc_anytag; /* global any tag */
SC_VDECL int glbstringread; /* last global string read */
SC_VDECL int sc_require_newdecls; /* only newdecls are allowed */
Expand Down

0 comments on commit 8e59926

Please sign in to comment.