X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fmiscfunctions.qc;h=070096fbf4d6db912bb50d7f9c88f0eaa4e8de9c;hb=f9c08b5c298e2604040f6af91f23a85e0e781fa4;hp=6ad35331ea5e67423a75c51afca8e5c197843fcf;hpb=74511aee30c0470380c6f99a472028465c3caf80;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/miscfunctions.qc b/qcsrc/client/miscfunctions.qc index 6ad35331e..070096fbf 100644 --- a/qcsrc/client/miscfunctions.qc +++ b/qcsrc/client/miscfunctions.qc @@ -279,16 +279,20 @@ var string _drawpic_picpath; #define drawpic_aspect(pos,pic,mySize,color,theAlpha,drawflag)\ do {\ _drawpic_imgsize = draw_getimagesize(pic);\ - _drawpic_imgaspect = _drawpic_imgsize_x/_drawpic_imgsize_y;\ - _drawpic_sz = mySize;\ - if(_drawpic_sz_x/_drawpic_sz_y > _drawpic_imgaspect) {\ - _drawpic_oldsz = _drawpic_sz_x;\ - _drawpic_sz_x = _drawpic_sz_y * _drawpic_imgaspect;\ - drawpic(pos + eX * (_drawpic_oldsz - _drawpic_sz_x) * 0.5, pic, _drawpic_sz, color, theAlpha, drawflag);\ - } else {\ - _drawpic_oldsz = _drawpic_sz_y;\ - _drawpic_sz_y = _drawpic_sz_x / _drawpic_imgaspect;\ - drawpic(pos + eY * (_drawpic_oldsz - _drawpic_sz_y) * 0.5, pic, _drawpic_sz, color, theAlpha, drawflag);\ + if(_drawpic_imgsize != '0 0 0') {\ + _drawpic_imgaspect = _drawpic_imgsize_x/_drawpic_imgsize_y;\ + _drawpic_sz = mySize;\ + if(_drawpic_sz_x/_drawpic_sz_y > _drawpic_imgaspect) {\ + _drawpic_oldsz = _drawpic_sz_x;\ + _drawpic_sz_x = _drawpic_sz_y * _drawpic_imgaspect;\ + if(_drawpic_sz_x)\ + drawpic(pos + eX * (_drawpic_oldsz - _drawpic_sz_x) * 0.5, pic, _drawpic_sz, color, theAlpha, drawflag);\ + } else {\ + _drawpic_oldsz = _drawpic_sz_y;\ + _drawpic_sz_y = _drawpic_sz_x / _drawpic_imgaspect;\ + if(_drawpic_sz_y)\ + drawpic(pos + eY * (_drawpic_oldsz - _drawpic_sz_y) * 0.5, pic, _drawpic_sz, color, theAlpha, drawflag);\ + }\ }\ } while(0) @@ -575,7 +579,7 @@ vector getplayerorigin(float pl) string s; entity e; - e = CSQCPlayer_GetPlayer(pl + 1); + e = CSQCModel_server2csqc(pl + 1); if(e) return e.origin; @@ -591,3 +595,35 @@ vector getplayerorigin(float pl) return GETPLAYERORIGIN_ERROR; } + +float getplayerisdead(float pl) +{ + entity e; + + e = CSQCModel_server2csqc(pl + 1); + if(e) + return e.csqcmodel_isdead; + + return FALSE; +} + +void URI_Get_Callback(float id, float status, string data) +{ + if(url_URI_Get_Callback(id, status, data)) + { + // handled + } + else if (id == URI_GET_DISCARD) + { + // discard + } + else if (id >= URI_GET_CURL && id <= URI_GET_CURL_END) + { + // sv_cmd curl + Curl_URI_Get_Callback(id, status, data); + } + else + { + print(sprintf(_("Received HTTP request data for an invalid id %d.\n"), id)); + } +}