stop players being naked when taking next clients on stable servers

This commit is contained in:
darkrose 2014-11-01 03:21:50 +10:00
parent a18d3051b2
commit db12e2cce3
4 changed files with 44 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 507 B

After

Width:  |  Height:  |  Size: 545 B

View File

@ -40,6 +40,7 @@
#include "log.h"
#include "http.h"
#include "sound.h"
#include "content_clothesitem.h"
/*
QueuedMeshUpdate
@ -1451,7 +1452,45 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id)
if (itm == CONTENT_IGNORE) {
inv->deleteItem(0);
}else{
delete inv->changeItem(0, InventoryItem::create(itm,1));
InventoryItem *item = inv->changeItem(0, InventoryItem::create(itm,1));
if (item)
delete item;
}
}
// for 1409 servers, this stops players appearing naked
if (icount == 5) {
{
InventoryList *inv = player->inventory.getList("shirt");
if (!inv->getItem(0)) {
InventoryItem *item = inv->changeItem(
0,
InventoryItem::create(CONTENT_CLOTHESITEM_COTTON_TSHIRT_GREEN,1)
);
if (item)
delete item;
}
}
{
InventoryList *inv = player->inventory.getList("pants");
if (!inv->getItem(0)) {
InventoryItem *item = inv->changeItem(
0,
InventoryItem::create(CONTENT_CLOTHESITEM_CANVAS_PANTS_BLUE,1)
);
if (item)
delete item;
}
}
{
InventoryList *inv = player->inventory.getList("boots");
if (!inv->getItem(0)) {
InventoryItem *item = inv->changeItem(
0,
InventoryItem::create(CONTENT_CLOTHESITEM_LEATHER_SHOES,1)
);
if (item)
delete item;
}
}
}
player->wieldItem(0);

View File

@ -591,11 +591,12 @@ void RemotePlayer::move(f32 dtime, Map &map, f32 pos_max_d)
m_pos_animation_counter += dtime;
v3f movevector = m_position - m_oldpos;
f32 moveratio;
if(m_pos_animation_time < 0.001)
if (m_pos_animation_time < 0.001) {
moveratio = 1.0;
else
}else{
moveratio = m_pos_animation_counter / m_pos_animation_time;
if(moveratio > 1.5)
}
if (moveratio > 1.5)
moveratio = 1.5;
m_showpos = m_oldpos + movevector * moveratio;