Minor fixes.

This commit is contained in:
jeefo 2019-08-12 22:51:26 +03:00
commit 858d247893
10 changed files with 37 additions and 57 deletions

View file

@ -170,13 +170,8 @@ public:
return m_weapons.begin ();
}
// set's the weapon properties
void setWeaponProp (WeaponProp prop) {
m_weaponProps[prop.id] = cr::move (prop);
}
// get's the weapons prop
const WeaponProp &getWeaponProp (int id) const {
WeaponProp &getWeaponProp (int id) {
return m_weaponProps[id];
}

View file

@ -180,11 +180,11 @@ public:
public:
int32 &next () {
return at (m_cursor + 1);
return at (1);
}
int32 &first () {
return at (m_cursor);
return at (0);
}
int32 &last () {
@ -192,7 +192,7 @@ public:
}
int32 &at (size_t index) {
return m_storage.at (index);
return m_storage.at (m_cursor + index);
}
void shift () {
@ -210,10 +210,6 @@ public:
return m_storage.length () - m_cursor;
}
size_t cursor () const {
return m_cursor;
}
bool hasNext () const {
return m_cursor < m_storage.length ();
}

View file

@ -87,8 +87,6 @@ private:
Dictionary <String, int32> m_teamInfoCache; // cache for teaminfo message
private:
bool m_broadcast; // message for all players
Bot *m_bot; // owner of a message
NetMsg m_current; // ongoing message id
@ -124,7 +122,7 @@ public:
public:
void registerMessage (const String &name, int32 id);
void start (edict_t *ent, int32 dest, int32 type);
void start (edict_t *ent, int32 type);
void stop ();
public:
@ -147,7 +145,6 @@ private:
void reset () {
m_current = NetMsg::None;
m_bot = nullptr;
m_broadcast = false;
}
};

View file

@ -494,25 +494,23 @@ struct WeaponInfo {
bool primaryFireHold; // hold down primary fire button to use?
public:
WeaponInfo (int id, const char *name, const char *model, int price, int minPriAmmo, int teamStd,
int teamAs, int buyGroup, int buySelect, int buySelectT, int buySelectCT, int penetratePower,
int maxClip, bool fireHold) {
this->id = id;
this->name = name;
this->model = model;
this->price = price;
this->minPrimaryAmmo = minPriAmmo;
this->teamStandard = teamStd;
this->teamAS = teamAs;
this->buyGroup = buyGroup;
this->buySelect = buySelect;
this->buySelectCT = buySelectCT;
this->buySelectT = buySelectT;
this->penetratePower = penetratePower;
this->maxClip = maxClip;
this->primaryFireHold = fireHold;
}
WeaponInfo (int id,
const char *name,
const char *model,
int price,
int minPriAmmo,
int teamStd,
int teamAs,
int buyGroup,
int buySelect,
int buySelectT,
int buySelectCT,
int penetratePower,
int maxClip,
bool fireHold) : id (id), name (name), model (model), price (price), minPrimaryAmmo (minPriAmmo), teamStandard (teamStd),
teamAS (teamAs), buyGroup (buyGroup), buySelect (buySelect), buySelectT (buySelectT), buySelectCT (buySelectCT),
penetratePower (penetratePower), maxClip (maxClip), primaryFireHold (fireHold)
{ }
};
// array of clients struct