| 523 | } |
| 524 | |
| 525 | bool CGameContext::SnapPickup(const CSnapContext &Context, int SnapId, const vec2 &Pos, int Type, int SubType, int SwitchNumber, int Flags) const |
| 526 | { |
| 527 | if(Context.IsSixup()) |
| 528 | { |
| 529 | protocol7::CNetObj_Pickup *pPickup = Server()->SnapNewItem<protocol7::CNetObj_Pickup>(SnapId); |
| 530 | if(!pPickup) |
| 531 | return false; |
| 532 | |
| 533 | pPickup->m_X = (int)Pos.x; |
| 534 | pPickup->m_Y = (int)Pos.y; |
| 535 | pPickup->m_Type = PickupType_SixToSeven(Type, SubType); |
| 536 | } |
| 537 | else if(Context.GetClientVersion() >= VERSION_DDNET_ENTITY_NETOBJS) |
| 538 | { |
| 539 | CNetObj_DDNetPickup *pPickup = Server()->SnapNewItem<CNetObj_DDNetPickup>(SnapId); |
| 540 | if(!pPickup) |
| 541 | return false; |
| 542 | |
| 543 | pPickup->m_X = (int)Pos.x; |
| 544 | pPickup->m_Y = (int)Pos.y; |
| 545 | pPickup->m_Type = Type; |
| 546 | pPickup->m_Subtype = SubType; |
| 547 | pPickup->m_SwitchNumber = SwitchNumber; |
| 548 | pPickup->m_Flags = Flags; |
| 549 | } |
| 550 | else |
| 551 | { |
| 552 | CNetObj_Pickup *pPickup = Server()->SnapNewItem<CNetObj_Pickup>(SnapId); |
| 553 | if(!pPickup) |
| 554 | return false; |
| 555 | |
| 556 | pPickup->m_X = (int)Pos.x; |
| 557 | pPickup->m_Y = (int)Pos.y; |
| 558 | |
| 559 | pPickup->m_Type = Type; |
| 560 | if(Context.GetClientVersion() < VERSION_DDNET_WEAPON_SHIELDS) |
| 561 | { |
| 562 | if(Type >= POWERUP_ARMOR_SHOTGUN && Type <= POWERUP_ARMOR_LASER) |
| 563 | { |
| 564 | pPickup->m_Type = POWERUP_ARMOR; |
| 565 | } |
| 566 | } |
| 567 | pPickup->m_Subtype = SubType; |
| 568 | } |
| 569 | |
| 570 | return true; |
| 571 | } |
| 572 | |
| 573 | void CGameContext::CallVote(int ClientId, const char *pDesc, const char *pCmd, const char *pReason, const char *pChatmsg, const char *pSixupDesc) |
| 574 | { |
no test coverage detected