This commit is contained in:
aozhiwei 2019-04-02 19:18:09 +08:00
parent ff1b987d33
commit a36d16e5cb
3 changed files with 58 additions and 0 deletions

View File

@ -310,6 +310,11 @@ void Player::LootInteraction(Loot* entity)
if (item_meta->i->_inventory_slot() >= 0 &&
item_meta->i->_inventory_slot() < MAX_INVENTORY_NUM) {
inventory[item_meta->i->_inventory_slot()] += entity->count;
if (item_meta->i->_inventory_slot() > 12) {
if (item_meta->i->_inventory_slot() - 12 > curr_scope_idx) {
curr_scope_idx = item_meta->i->_inventory_slot() - 12;
}
}
need_sync_active_player = true;
}
}

View File

@ -0,0 +1,26 @@
#include "precompile.h"
#include "smoke.h"
#include "metamgr.h"
#include "movement.h"
#include "room.h"
#include "collider.h"
#include "obstacle.h"
#include "player.h"
Smoke::Smoke():Entity()
{
entity_type = ET_Smoke;
}
Smoke::~Smoke()
{
}
void Smoke::Initialize()
{
}
void Smoke::Update(int delta_time)
{
}

View File

@ -0,0 +1,27 @@
#pragma once
#include "entity.h"
namespace MetaData
{
struct Player;
struct Equip;
}
class Human;
class Smoke : public Entity
{
public:
MetaData::Equip* gun_meta = nullptr;
MetaData::Equip* meta = nullptr;
Human* player = nullptr;
Vector2D dir;
Vector2D born_pos;
Vector2D born_dir;
Smoke();
virtual ~Smoke() override;
virtual void Initialize() override;
virtual void Update(int delta_time) override;
};