6651: Fix swapping with dragger beams (fixes #6597) r=Robyt3 a=def-

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
This commit is contained in:
bors[bot] 2023-05-23 15:54:06 +00:00 committed by GitHub
commit fa2e7ca7f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -218,3 +218,8 @@ void CDragger::Snap(int SnappingClient)
GameServer()->SnapLaserObject(CSnapContext(SnappingClientVersion), GetID(),
m_Pos, m_Pos, StartTick, -1, LASERTYPE_DRAGGER, Subtype, m_Number);
}
void CDragger::SwapClients(int Client1, int Client2)
{
std::swap(m_apDraggerBeam[Client1], m_apDraggerBeam[Client2]);
}

View file

@ -40,6 +40,7 @@ public:
void Reset() override;
void Tick() override;
void Snap(int SnappingClient) override;
void SwapClients(int Client1, int Client2) override;
};
#endif // GAME_SERVER_ENTITIES_DRAGGER_H