Merge remote-tracking branch 'origin/master'

This commit is contained in:
TotallyNotElite 2019-04-17 20:09:39 +02:00
commit e381be7d71
4 changed files with 16 additions and 11 deletions

View File

@ -14,7 +14,7 @@
-1927.023193f, -936.055847f, -255.970061f, 2.673917f, 179.936523f, "ctf_turbine" -1927.023193f, -936.055847f, -255.970061f, 2.673917f, 179.936523f, "ctf_turbine"
// Swiftwater // Swiftwater
5543.948730f, -1527.988037f, -1023.96875f, 23.115799f, -0.012952f, "pl_swiftwater_final1" 5543.948730f, -1527.988037f, -1023.96875f, 23.115799f, -0.012952f, "pl_swiftwater_final1"
2636.031250f, -1126.089478f, 13.124457f, -1130.14154f, 179.843811f, "pl_swiftwater_final1" 2636.031250f, -1126.089478f, 13.124457f, 0.0f, 179.843811f, "pl_swiftwater_final1"
// Thundermountain // Thundermountain
// Phase 1 // Phase 1
-1068.001587f, -3724.079834f, 132.000061f - 68.000061f, 17.606197f, 0.118330f, "pl_thundermountain" -1068.001587f, -3724.079834f, 132.000061f - 68.000061f, 17.606197f, 0.118330f, "pl_thundermountain"
@ -24,4 +24,4 @@
// Phase 3 // Phase 3
2191.972900f, 3353.798340f, 452.031311f - 68.000061f, 12.601318f, 89.972534f, "pl_thundermountain" 2191.972900f, 3353.798340f, 452.031311f - 68.000061f, 12.601318f, 89.972534f, "pl_thundermountain"
4889.611328f, 4287.997070f, 576.031250f, 11.911232f, 179.998672f, "pl_thundermountain" 4889.611328f, 4287.997070f, 576.031250f, 11.911232f, 179.998672f, "pl_thundermountain"
-3327.432129f, -928.000366f, -311.968750f, 7.452800f, 89.949173f, "cp_mossrock" -3328.097656f, -928.001221f, -311.968750f, -1.423861f, 89.814667f,"cp_mossrock"

View File

@ -7,7 +7,7 @@
#pragma once #pragma once
#include <map> #include <unordered_map>
#include <string> #include <string>
#include <vector> #include <vector>
@ -139,8 +139,8 @@ public:
void RegisterItem(std::string modelpath, k_EItemType type); void RegisterItem(std::string modelpath, k_EItemType type);
k_EItemType GetItemType(CachedEntity *entity); k_EItemType GetItemType(CachedEntity *entity);
std::map<std::string, k_EItemType> models; std::unordered_map<std::string, k_EItemType> models;
std::map<uintptr_t, k_EItemType> map; std::unordered_map<uintptr_t, k_EItemType> map;
}; };
class ItemManager class ItemManager
@ -151,7 +151,7 @@ public:
void RegisterSpecialMapping(ItemCheckerFn fn, k_EItemType type); void RegisterSpecialMapping(ItemCheckerFn fn, k_EItemType type);
k_EItemType GetItemType(CachedEntity *ent); k_EItemType GetItemType(CachedEntity *ent);
std::map<ItemCheckerFn, k_EItemType> special_map; std::unordered_map<ItemCheckerFn, k_EItemType> special_map;
std::vector<ItemSpecialMapperFn> specials; std::vector<ItemSpecialMapperFn> specials;
ItemModelMapper mapper_special; ItemModelMapper mapper_special;
ItemModelMapper mapper; ItemModelMapper mapper;

View File

@ -144,16 +144,20 @@ int getCarriedBuilding()
return -1; return -1;
} }
static settings::Button oob_helper{ "oob_helper", "<null>" }; static settings::Button oob_helper{ "oob_helper", "<null>" };
static settings::Bool oob_helper_slow{ "oob_helper_slow", "true" };
void CreateMove() void CreateMove()
{ {
if (oob_helper && oob_helper.isKeyDown()) if (oob_helper && oob_helper.isKeyDown())
{ {
if (CE_GOOD(LOCAL_E) && LOCAL_E->m_bAlivePlayer()) if (CE_GOOD(LOCAL_E) && LOCAL_E->m_bAlivePlayer())
{
if (oob_helper_slow)
{ {
if (current_user_cmd->sidemove) if (current_user_cmd->sidemove)
current_user_cmd->sidemove = current_user_cmd->sidemove < 0.0f ? -1.0001f : 1.0001f; current_user_cmd->sidemove = current_user_cmd->sidemove < 0.0f ? -1.0001f : 1.0001f;
if (current_user_cmd->forwardmove) if (current_user_cmd->forwardmove)
current_user_cmd->forwardmove = current_user_cmd->forwardmove < 0.0f ? -1.0001f : 1.0001f; current_user_cmd->forwardmove = current_user_cmd->forwardmove < 0.0f ? -1.0001f : 1.0001f;
}
int building_idx = getCarriedBuilding(); int building_idx = getCarriedBuilding();
if (building_idx != -1) if (building_idx != -1)
{ {

View File

@ -219,3 +219,4 @@ k_EItemType ItemModelMapper::GetItemType(CachedEntity *entity)
} }
ItemManager g_ItemManager; ItemManager g_ItemManager;
static InitRoutine init([]() { EC::Register(EC::LevelInit, []() { g_ItemManager = ItemManager{}; }, "clear_itemtypes"); });