bool IsParsed = false;
const char *pname = Client()->PlayerName();
if(!IsParsed)
{
m_pClient->m_Stats.FetchPlayer(&s_StatsPlayer, pname);
if(!s_StatsPlayer.m_pGetStatsDDStats)
return;
if(s_StatsPlayer.m_pGetStatsDDStats->State() == s_StatsPlayer.m_pGetStatsDDStats->STATE_PENDING)
return;
if(!s_StatsPlayer.StatsParsed && s_StatsPlayer.m_pGetStatsDDStats->State() == s_StatsPlayer.m_pGetStatsDDStats->STATE_DONE)
return m_pClient->m_Stats.ParseJSON(&s_StatsPlayer); IsParsed = true;
}
return m_pClient->m_Stats.ParseJSON(&s_StatsPlayer);
does what it should, return!, placing isParsed = true
after that has no effect (edited) int m_TileIndex = GameServer()->Collision()->GetTileIndex(MapIndex);
int m_TileFIndex = GameServer()->Collision()->GetFTileIndex(MapIndex);
//Sensitivity
int S1 = GameServer()->Collision()->GetPureMapIndex(vec2(pChr->GetPos().x + pChr->GetProximityRadius() / 3.f, pChr->GetPos().y - pChr->GetProximityRadius() / 3.f));
int S2 = GameServer()->Collision()->GetPureMapIndex(vec2(pChr->GetPos().x + pChr->GetProximityRadius() / 3.f, pChr->GetPos().y + pChr->GetProximityRadius() / 3.f));
int S3 = GameServer()->Collision()->GetPureMapIndex(vec2(pChr->GetPos().x - pChr->GetProximityRadius() / 3.f, pChr->GetPos().y - pChr->GetProximityRadius() / 3.f));
int S4 = GameServer()->Collision()->GetPureMapIndex(vec2(pChr->GetPos().x - pChr->GetProximityRadius() / 3.f, pChr->GetPos().y + pChr->GetProximityRadius() / 3.f));
int Tile1 = GameServer()->Collision()->GetTileIndex(S1);
int Tile2 = GameServer()->Collision()->GetTileIndex(S2);
int Tile3 = GameServer()->Collision()->GetTileIndex(S3);
int Tile4 = GameServer()->Collision()->GetTileIndex(S4);
int FTile1 = GameServer()->Collision()->GetFTileIndex(S1);
int FTile2 = GameServer()->Collision()->GetFTileIndex(S2);
int FTile3 = GameServer()->Collision()->GetFTileIndex(S3);
int FTile4 = GameServer()->Collision()->GetFTileIndex(S4);
(edited)return m_pTiles[Index].m_Index;
git add .
git commit
git push
git commit --amend
git push -f
and a few more that i frequently use but those are my daily musts xdgit status
git diff
and git diff --cached
git log
i use those bithses daily for surefetch
, push
, rebase
, reset
, status
, stash
diff
sometimes, and very rarely cherry-pick
git pull
git add . && git reset --hard
is baegit cherry-pick -n commithash
git reset --hard HEAD
git push origin master --force
git commit -m "FUCK"
(edited)git commit -m FUCK
std::unique_ptr
? I am pretty new to Cpp std::unique_ptr<int> test = std::make_unique(10);
. deleting is handled automaticallyPurgeUntil
in src/engine/client/client.cpp)std::unique_ptr<int> test = std::make_unique(10);
. deleting is handled automatically struct Base {
virtual int number() = 0;
virtual ~Base() = default;
};
struct Derived : public Base {
int number() override {
return 10;
}
};
int main() {
vector<Base *> x;
x.emplace_back(new Derived);
cout << x.size() << " -> " << x[0] << "(" << x[0]->number() << ")" << endl;
for (const auto &item: x) {
delete item;
}
}
There are more structs like Derived
which inherit Base
. What would be the best way to clone vector<Base *> x
? I need the Base *
values inside also to be deep copied. Played around with copy/constructors but that didn't work out since the generic is a pointer I think.
Do I need to implement a virtual clone()
method manually in the base class and overwrite it in the subs, then call them in a loop to fill a new vector?
+ Bonus question. C++ is still super relevant for teeworlds development or is the whole thing slowly moving to rust? (Since masterserver for example is already written in rust)?struct Base {
virtual int number() = 0;
virtual ~Base() = default;
};
struct Derived : public Base {
int number() override {
return 10;
}
};
int main() {
vector<Base *> x;
x.emplace_back(new Derived);
cout << x.size() << " -> " << x[0] << "(" << x[0]->number() << ")" << endl;
for (const auto &item: x) {
delete item;
}
}
There are more structs like Derived
which inherit Base
. What would be the best way to clone vector<Base *> x
? I need the Base *
values inside also to be deep copied. Played around with copy/constructors but that didn't work out since the generic is a pointer I think.
Do I need to implement a virtual clone()
method manually in the base class and overwrite it in the subs, then call them in a loop to fill a new vector?
+ Bonus question. C++ is still super relevant for teeworlds development or is the whole thing slowly moving to rust? (Since masterserver for example is already written in rust)? emplace_back
fails for examplestd::unique_ptr
over raw pointers, I thinkstruct Base {
virtual int number() = 0;
virtual ~Base() = default;
};
struct Derived : public Base {
int number() override {
return 10;
}
};
int main() {
vector<Base *> x;
x.emplace_back(new Derived);
cout << x.size() << " -> " << x[0] << "(" << x[0]->number() << ")" << endl;
for (const auto &item: x) {
delete item;
}
}
There are more structs like Derived
which inherit Base
. What would be the best way to clone vector<Base *> x
? I need the Base *
values inside also to be deep copied. Played around with copy/constructors but that didn't work out since the generic is a pointer I think.
Do I need to implement a virtual clone()
method manually in the base class and overwrite it in the subs, then call them in a loop to fill a new vector?
+ Bonus question. C++ is still super relevant for teeworlds development or is the whole thing slowly moving to rust? (Since masterserver for example is already written in rust)? virtual std::unique_ptr<Base> clone() const
is the only way I can think ofvirtual std::unique_ptr<Base> clone() const
is the only way I can think of virtual std::unique_ptr<Base> clone() const
is the only way I can think of Wood
class even have?unique_ptr
everywhere I can?Wood
class even have? unique_ptr
everywhere I can? Wood
being the baseclass of WoodHouse
wouldn’t really make much sense, why would you ever want WoodHouse
to inherit the price of wood? So that’s kinda why this is not the greatest use of OOPMaterial
(for Wood, Metal, Plastic, ...) and Building
for a few more (like SolarPowerPlant) where Building has a vector<Material *>
(edited)Material
(for Wood, Metal, Plastic, ...) and Building
for a few more (like SolarPowerPlant) where Building has a vector<Material *>
(edited)Material
(for Wood, Metal, Plastic, ...) and Building
for a few more (like SolarPowerPlant) where Building has a vector<Material *>
(edited)unique_ptr
zero-cost or are there some bytes overhead?git clone
counts "https://scrumplex.rocks/skin/"
"https://skins.ddnet.org/skin/community/"
"https://skins.tee.world/"
"https://assets.ddstats.org/skins/"
"https://api.skins.tw/api/resolve/skins/"
"https://scrumplex.rocks/skin/"
"https://skins.ddnet.org/skin/community/"
"https://skins.tee.world/"
"https://assets.ddstats.org/skins/"
"https://api.skins.tw/api/resolve/skins/"
"https://raw.githubusercontent.com/TeeworldsDB/skins/master/06/"
so this?archlinux-aur
[19:01:40] <polarian> Also maybe I am sinnical, but when a developer asks for their software to be adopted... it feels like you are trying to get your software out there... being adopted into the official repos gives you a lot of recognition... and I can say with experience I will install from official repositories over the AUR...
--rebuild
flag which will just rebuild an already existing derivation and compare bothexport SDL_AUDIODRIVER=pipewire
IGraphics::LoadTextureRawMove
function with non-const
void *pData
argument in addition to existing LoadTextureRaw
function with const void *pData
argument. The former function takes ownership of the data and avoids copying the texture data into an additional buffer, if the texture data is already in RGBA format. Non-RGBA texture data always needs to be converted and therefore also copied.
The LoadTextureRaw
function is split into smaller functions to share common c...