Ticket #1719: AttackNotificationApr112013.diff
File AttackNotificationApr112013.diff, 22.2 KB (added by , 11 years ago) |
---|
-
binaries/data/mods/public/gui/session/messages.js
diff --git a/binaries/data/mods/public/gui/session/messages.js b/binaries/data/mods/public/gui/session/messages.js index f296bcf..2440e17 100644
a b function handleNotifications() 78 78 "amounts": notification.amounts 79 79 }); 80 80 } 81 else if (notification.type == "attack") 82 { 83 if (notification.player == Engine.GetPlayerID()) 84 { 85 Engine.GuiInterfaceCall("PlaySound", { "name":"attacked", "entity": notification.message.target }); 86 } 87 } 81 88 else 82 89 { 83 90 // Only display notifications directed to this player … … function addChatMessage(msg, playerAssignments) 356 363 357 364 formatted = "[color=\"" + playerColor + "\"]" + username + "[/color] has sent you " + amounts + "."; 358 365 break; 366 case "attack": 367 if (msg.player != Engine.GetPlayerID()) 368 return; 369 370 formatted = "We're under attack!"; 371 break; 359 372 case "message": 360 373 // May have been hidden by the 'team' command. 361 374 if (msg.hide) -
binaries/data/mods/public/simulation/components/Armour.js
diff --git a/binaries/data/mods/public/simulation/components/Armour.js b/binaries/data/mods/public/simulation/components/Armour.js index eef945e..f5457ea 100644
a b Armour.prototype.SetInvulnerability = function(invulnerability) 42 42 this.invulnerable = invulnerability; 43 43 }; 44 44 45 Armour.prototype.TakeDamage = function(hack, pierce, crush )45 Armour.prototype.TakeDamage = function(hack, pierce, crush, source) 46 46 { 47 47 if (this.invulnerable) 48 48 return { "killed": false }; … … Armour.prototype.TakeDamage = function(hack, pierce, crush) 57 57 // Round to nearest integer, since HP is integral 58 58 var total = Math.max(1, Math.round(adjHack + adjPierce + adjCrush)); 59 59 60 // Alert target owner of attack 61 var cmpOwnership = Engine.QueryInterface(this.entity, IID_Ownership); 62 var cmpAttackDetection = QueryPlayerIDInterface(cmpOwnership.GetOwner(), IID_AttackDetection); 63 var cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer); 64 var now = cmpTimer.GetTime(); 65 if (!(this.lastAttack > now - cmpAttackDetection.GetSuppressionTime())) 66 cmpAttackDetection.AttackAlert(this.entity, source); 67 this.lastAttack = now; 68 60 69 // Reduce health 61 70 var cmpHealth = Engine.QueryInterface(this.entity, IID_Health); 62 71 return cmpHealth.Reduce(total); -
binaries/data/mods/public/simulation/components/Attack.js
diff --git a/binaries/data/mods/public/simulation/components/Attack.js b/binaries/data/mods/public/simulation/components/Attack.js index 0a9a707..469a582 100644
a b Attack.prototype.CauseDamage = function(data) 691 691 var cmpDamageReceiver = Engine.QueryInterface(data.target, IID_DamageReceiver); 692 692 if (!cmpDamageReceiver) 693 693 return; 694 var targetState = cmpDamageReceiver.TakeDamage(strengths.hack * damageMultiplier, strengths.pierce * damageMultiplier, strengths.crush * damageMultiplier );694 var targetState = cmpDamageReceiver.TakeDamage(strengths.hack * damageMultiplier, strengths.pierce * damageMultiplier, strengths.crush * damageMultiplier, this.entity); 695 695 // if target killed pick up loot and credit experience 696 696 if (targetState.killed == true) 697 697 { -
new file inaries/data/mods/public/simulation/components/AttackDetection.js
diff --git a/binaries/data/mods/public/simulation/components/AttackDetection.js b/binaries/data/mods/public/simulation/components/AttackDetection.js new file mode 100644 index 0000000..98448b8
- + 1 function AttackDetection() {} 2 3 AttackDetection.prototype.Schema = 4 "<a:help>Detects incoming attacks.</a:help>" + 5 "<a:example/>" + 6 "<a:component type='system'/>" + 7 "<empty/>"; 8 9 AttackDetection.prototype.Init = function() 10 { 11 this.suppressionTransferRange = 50; // Any attacks within this range will replace the previous attack suppression. 12 this.suppressionRange = 150; // Other attacks within this distance will not be registered. 13 this.suppressionTime = 40 * 1000; // Other attacks within this time will not be registered. 14 15 this.suppressedList = []; 16 }; 17 18 // Utility function for calculating the distance between two attack events. 19 AttackDetection.prototype.distance = function(pos1, pos2) 20 { 21 var xs = pos2.x - pos1.x; 22 var zs = pos2.z - pos1.z; 23 return Math.sqrt(Math.pow(xs, 2) + Math.pow(zs, 2)); 24 } 25 26 AttackDetection.prototype.addSuppression = function(event) 27 { 28 this.suppressedList.push(event); 29 30 var cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer); 31 cmpTimer.SetTimeout(this.entity, IID_AttackDetection, "HandleTimeout", this.suppressionTime); 32 } 33 34 AttackDetection.prototype.handleAttack = function(target, attacker) 35 { 36 var cmpPlayer = Engine.QueryInterface(this.entity, IID_Player); 37 var cmpOwnership = Engine.QueryInterface(target, IID_Ownership); 38 // Don't register attacks dealt against others. 39 if (cmpPlayer.GetPlayerID() != cmpOwnership.GetOwner()) 40 return; 41 42 var cmpPosition = Engine.QueryInterface(target, IID_Position); 43 if (!cmpPosition || !cmpPosition.IsInWorld()) 44 return; 45 var cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer); 46 var event = {target: target, position: cmpPosition.GetPosition(), time: cmpTimer.GetTime()}; 47 48 for (var i = 0; i < this.suppressedList.length; i++) 49 { 50 var element = this.suppressedList[i]; 51 52 // If the new attack is within suppression distance of this element then check if the element should be updated 53 // and then return. 54 var dist = this.distance(element.position, event.position); 55 if (dist < this.suppressionRange) 56 { 57 if (dist < this.suppressionTransferRange) 58 element = event; 59 return; 60 } 61 } 62 63 this.addSuppression(event); 64 Engine.PostMessage(this.entity, MT_AttackDetected, { "player": cmpPlayer.GetPlayerID(), "event": event }); 65 var cmpGuiInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); 66 cmpGuiInterface.PushNotification({"type": "attack", "player": cmpPlayer.GetPlayerID(), "message": event}); 67 }; 68 69 //// Message handlers //// 70 71 AttackDetection.prototype.OnGlobalAttacked = function(msg) 72 { 73 var cmpPlayer = Engine.QueryInterface(this.entity, IID_Player); 74 var cmpOwnership = Engine.QueryInterface(msg.target, IID_Ownership); 75 if (cmpOwnership.GetOwner() == cmpPlayer.GetPlayerID()) 76 Engine.PostMessage(msg.target, MT_PingOwner); 77 }; 78 79 //// External interface //// 80 81 AttackDetection.prototype.AttackAlert = function(target, attacker) 82 { 83 this.handleAttack(target, attacker); 84 }; 85 86 AttackDetection.prototype.GetSuppressionTime = function() 87 { 88 return this.suppressionTime; 89 }; 90 91 AttackDetection.prototype.HandleTimeout = function() 92 { 93 var cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer); 94 for (var i = 0; i < this.suppressedList.length; i++) 95 { 96 var event = this.suppressedList[i]; 97 98 // Check if this event has timed out. 99 if (cmpTimer.GetTime() - event.time >= this.suppressionTime) 100 { 101 this.suppressedList.splice(i, 1); 102 i--; 103 return; 104 } 105 } 106 }; 107 108 AttackDetection.prototype.GetIncomingAttacks = function() 109 { 110 return this.suppressedList; 111 }; 112 113 Engine.RegisterComponentType(IID_AttackDetection, "AttackDetection", AttackDetection); -
binaries/data/mods/public/simulation/components/GuiInterface.js
diff --git a/binaries/data/mods/public/simulation/components/GuiInterface.js b/binaries/data/mods/public/simulation/components/GuiInterface.js index a5418be..da8dc99 100644
a b GuiInterface.prototype.GetBattleState = function(player) 620 620 return cmpBattleDetection.GetState(); 621 621 }; 622 622 623 // Returns a list of ongoing attacks against the player. 624 GuiInterface.prototype.GetIncomingAttacks = function(player) 625 { 626 var cmpAttackDetection = QueryPlayerIDInterface(player, IID_AttackDetection); 627 return cmpAttackDetection.GetIncomingAttacks(); 628 }; 629 623 630 // Used to show a red square over GUI elements you can't yet afford. 624 631 GuiInterface.prototype.GetNeededResources = function(player, amounts) 625 632 { … … var exposedFunctions = { 1720 1727 "CheckTechnologyRequirements": 1, 1721 1728 "GetStartedResearch": 1, 1722 1729 "GetBattleState": 1, 1730 "GetIncomingAttacks": 1, 1723 1731 "GetNeededResources": 1, 1724 1732 "GetNextNotification": 1, 1725 1733 -
new file inaries/data/mods/public/simulation/components/interfaces/AttackDetection.js
diff --git a/binaries/data/mods/public/simulation/components/interfaces/AttackDetection.js b/binaries/data/mods/public/simulation/components/interfaces/AttackDetection.js new file mode 100644 index 0000000..d168646
- + 1 Engine.RegisterInterface("AttackDetection"); 2 3 // Message of the form { "event": { "target": 123, "position": { "x": 123, "z": 456 }, "time": 1 }. 4 // sent when an entity is attacked. 5 //Engine.RegisterMessageType("EntityAttacked"); 6 7 // Message of the form { "player": 1, "event": { "target": 123 , "position": { "x": 123, "z": 456 }, "time": 1, }. 8 // sent when a new attack is detected. 9 Engine.RegisterMessageType("AttackDetected"); -
binaries/data/mods/public/simulation/templates/special/player.xml
diff --git a/binaries/data/mods/public/simulation/templates/special/player.xml b/binaries/data/mods/public/simulation/templates/special/player.xml index eaa28e6..97ff335 100644
a b 12 12 <Player/> 13 13 <StatisticsTracker/> 14 14 <TechnologyManager/> 15 <AttackDetection/> 15 16 <BattleDetection> 16 17 <TimerInterval>200</TimerInterval> 17 18 <RecordLength>12</RecordLength> -
binaries/data/mods/public/simulation/templates/template_structure.xml
diff --git a/binaries/data/mods/public/simulation/templates/template_structure.xml b/binaries/data/mods/public/simulation/templates/template_structure.xml index bfe0e5e..f20fdfc 100644
a b 85 85 <select>interface/select/building/sel_universal.xml</select> 86 86 <constructed>interface/complete/building/complete_universal.xml</constructed> 87 87 <death>attack/destruction/building_collapse_large.xml</death> 88 <attacked>interface/alarm/alarm_attackplayer.xml</attacked> 88 89 </SoundGroups> 89 90 </Sound> 90 91 <StatusBars> -
binaries/data/mods/public/simulation/templates/template_unit_cavalry.xml
diff --git a/binaries/data/mods/public/simulation/templates/template_unit_cavalry.xml b/binaries/data/mods/public/simulation/templates/template_unit_cavalry.xml index 420836e..a16aa0c 100644
a b 79 79 <walk>actor/mounted/movement/walk.xml</walk> 80 80 <run>actor/mounted/movement/walk.xml</run> 81 81 <attack>attack/weapon/sword.xml</attack> 82 <attacked>interface/alarm/alarm_attackplayer.xml</attacked> 82 83 <death>actor/fauna/death/death_horse.xml</death> 83 84 <trained>interface/alarm/alarm_create_cav.xml</trained> 84 85 </SoundGroups> -
binaries/data/mods/public/simulation/templates/template_unit_champion.xml
diff --git a/binaries/data/mods/public/simulation/templates/template_unit_champion.xml b/binaries/data/mods/public/simulation/templates/template_unit_champion.xml index 11b332e..16f5745 100644
a b 14 14 <stone>0</stone> 15 15 <metal>20</metal> 16 16 </Loot> 17 <Sound> 18 <SoundGroups> 19 <attacked>interface/alarm/alarm_attackplayer.xml</attacked> 20 </SoundGroups> 21 </Sound> 17 22 </Entity> -
binaries/data/mods/public/simulation/templates/template_unit_hero.xml
diff --git a/binaries/data/mods/public/simulation/templates/template_unit_hero.xml b/binaries/data/mods/public/simulation/templates/template_unit_hero.xml index b36b629..9e8daaa 100644
a b 60 60 <Sound> 61 61 <SoundGroups> 62 62 <attack>attack/weapon/sword.xml</attack> 63 <attacked>interface/alarm/alarm_attackplayer.xml</attacked> 63 64 <death>actor/human/death/death.xml</death> 64 65 </SoundGroups> 65 66 </Sound> -
binaries/data/mods/public/simulation/templates/template_unit_infantry.xml
diff --git a/binaries/data/mods/public/simulation/templates/template_unit_infantry.xml b/binaries/data/mods/public/simulation/templates/template_unit_infantry.xml index 427a03a..fe16b3b 100644
a b 92 92 <Sound> 93 93 <SoundGroups> 94 94 <select>voice/hellenes/civ/civ_male_select.xml</select> 95 <attacked>interface/alarm/alarm_attackplayer.xml</attacked> 95 96 <order_walk>voice/hellenes/civ/civ_male_ack.xml</order_walk> 96 97 <order_attack>voice/hellenes/civ/civ_male_attack.xml</order_attack> 97 98 <order_gather>voice/hellenes/civ/civ_male_ack.xml</order_gather> -
binaries/data/mods/public/simulation/templates/template_unit_mechanical.xml
diff --git a/binaries/data/mods/public/simulation/templates/template_unit_mechanical.xml b/binaries/data/mods/public/simulation/templates/template_unit_mechanical.xml index 3a73cc7..67d63bd 100644
a b 21 21 <stone>0</stone> 22 22 <metal>25</metal> 23 23 </Loot> 24 <Sound> 25 <SoundGroups> 26 <attacked>interface/alarm/alarm_attackplayer.xml</attacked> 27 </SoundGroups> 28 </Sound> 24 29 </Entity> -
binaries/data/mods/public/simulation/templates/template_unit_support.xml
diff --git a/binaries/data/mods/public/simulation/templates/template_unit_support.xml b/binaries/data/mods/public/simulation/templates/template_unit_support.xml index 7c37c1a..a327fac 100644
a b 23 23 <Sound> 24 24 <SoundGroups> 25 25 <trained>interface/alarm/alarm_create_worker.xml</trained> 26 <attacked>interface/alarm/alarm_attackplayer.xml</attacked> 26 27 </SoundGroups> 27 28 </Sound> 28 29 <UnitAI> -
source/gui/MiniMap.cpp
diff --git a/source/gui/MiniMap.cpp b/source/gui/MiniMap.cpp index ad1b7f9..793578b 100644
a b 1 /* Copyright (C) 201 2Wildfire Games.1 /* Copyright (C) 2013 Wildfire Games. 2 2 * This file is part of 0 A.D. 3 3 * 4 4 * 0 A.D. is free software: you can redistribute it and/or modify … … static unsigned int ScaleColor(unsigned int color, float x) 69 69 m_ShallowPassageHeight = pathingSettings.GetChild("default").GetChild("MaxWaterDepth").ToFloat(); 70 70 else 71 71 m_ShallowPassageHeight = 0.0f; 72 73 m_ChangePingColor = 0; 72 74 } 73 75 74 76 CMiniMap::~CMiniMap() … … void CMiniMap::Draw() 469 471 v.a = 255; 470 472 v.x = posX.ToFloat()*sx; 471 473 v.y = -posZ.ToFloat()*sy; 474 475 // Check minimap pinging to indicate something 476 if (cmpMinimap->IsEntityPinging()) { 477 478 // Override the normal rendering of the entity with the ping color 479 // Note: If the pinged entity's dot is rendered over by another entity's 480 // dot then it will be invisible & the ping will be not be seen. 481 // We can try to move the pinged dots towards the end in the vertexArray 482 // Keep 2 pointers and insert pinged dots at end, unpinged at current position 483 if (m_ChangePingColor > PING_DURATION/2) { 484 v.r = 255; // bright red 485 v.g = 1; 486 v.b = 1; 487 } 488 489 // Must reduce ping count every frame 490 u32 pingCount = cmpMinimap->GetRemainingPingCount(); 491 if (pingCount <= 0) { 492 // Also turns off ping flag if 0 passed in 493 cmpMinimap->SetRemainingPingCount(0); 494 } 495 else { 496 cmpMinimap->SetRemainingPingCount(pingCount - 1); 497 } 498 } 499 472 500 vertexArray.push_back(v); 473 501 } 474 502 } 475 503 } 476 504 505 // Cycle the ping color counter as needed 506 m_ChangePingColor = (m_ChangePingColor + 1) > PING_DURATION ? 0 : (m_ChangePingColor + 1); 507 477 508 if (!vertexArray.empty()) 478 509 { 479 510 glEnableClientState(GL_VERTEX_ARRAY); … … void CMiniMap::Draw() 497 528 } 498 529 499 530 PROFILE_END("minimap units"); 500 531 501 532 if (g_Renderer.GetRenderPath() == CRenderer::RP_SHADER) 502 533 { 503 534 tech->EndPass(); -
source/gui/MiniMap.h
diff --git a/source/gui/MiniMap.h b/source/gui/MiniMap.h index 4fbc34a..5c6c7a2 100644
a b 1 /* Copyright (C) 201 2Wildfire Games.1 /* Copyright (C) 2013 Wildfire Games. 2 2 * This file is part of 0 A.D. 3 3 * 4 4 * 0 A.D. is free software: you can redistribute it and/or modify … … 18 18 #ifndef INCLUDED_MINIMAP 19 19 #define INCLUDED_MINIMAP 20 20 21 // GUI 21 22 #include "gui/GUI.h" 22 23 24 // Types 25 #include "lib/types.h" 26 23 27 class CCamera; 24 28 class CTerrain; 25 29 30 // Pinging constants - Controls blink duration of the ping, smaller means higher 31 // ping frequency 32 const unsigned int PING_DURATION = 50; 33 26 34 class CMiniMap : public IGUIObject 27 35 { 28 36 GUI_OBJECT(CMiniMap) 29 37 public: 30 38 CMiniMap(); 31 39 virtual ~CMiniMap(); 40 32 41 protected: 33 42 virtual void Draw(); 34 43 … … class CMiniMap : public IGUIObject 81 90 // maximal water height to allow the passage of a unit (for underwater shallows). 82 91 float m_ShallowPassageHeight; 83 92 93 // For tracking the ping color 94 u32 m_ChangePingColor; 95 84 96 void DrawTexture(float coordMax, float angle, float x, float y, float x2, float y2, float z); 85 97 86 98 void DrawViewRect(); -
source/simulation2/MessageTypes.h
diff --git a/source/simulation2/MessageTypes.h b/source/simulation2/MessageTypes.h index de8a31b..9ca5f9b 100644
a b class CMessageVisionRangeChanged : public CMessage 398 398 entity_pos_t newRange; 399 399 }; 400 400 401 /** 402 * Sent when an entity is pinged 403 */ 404 class CMessagePingOwner : public CMessage 405 { 406 public: 407 DEFAULT_MESSAGE_IMPL(PingOwner) 408 409 CMessagePingOwner() 410 { 411 } 412 }; 413 401 414 #endif // INCLUDED_MESSAGETYPES -
source/simulation2/TypeList.h
diff --git a/source/simulation2/TypeList.h b/source/simulation2/TypeList.h index f14848c..663f3e7 100644
a b 49 49 MESSAGE(PathResult) 50 50 MESSAGE(TechnologyModification) 51 51 MESSAGE(VisionRangeChanged) 52 MESSAGE(PingOwner) 52 53 53 54 // TemplateManager must come before all other (non-test) components, 54 55 // so that it is the first to be (de)serialized -
source/simulation2/components/CCmpMinimap.cpp
diff --git a/source/simulation2/components/CCmpMinimap.cpp b/source/simulation2/components/CCmpMinimap.cpp index ac8004d..fb3daf9 100644
a b 1 /* Copyright (C) 201 2Wildfire Games.1 /* Copyright (C) 2013 Wildfire Games. 2 2 * This file is part of 0 A.D. 3 3 * 4 4 * 0 A.D. is free software: you can redistribute it and/or modify … … 22 22 23 23 #include "simulation2/components/ICmpPlayerManager.h" 24 24 #include "simulation2/components/ICmpPlayer.h" 25 #include "simulation2/components/ICmpOwnership.h" 25 26 #include "simulation2/MessageTypes.h" 26 27 27 28 #include "ps/Overlay.h" 29 #include "ps/Game.h" 28 30 29 31 class CCmpMinimap : public ICmpMinimap 30 32 { … … class CCmpMinimap : public ICmpMinimap 33 35 { 34 36 componentManager.SubscribeToMessageType(MT_PositionChanged); 35 37 componentManager.SubscribeToMessageType(MT_OwnershipChanged); 38 componentManager.SubscribeToMessageType(MT_PingOwner); 36 39 } 37 40 38 41 DEFAULT_COMPONENT_ALLOCATOR(Minimap) … … class CCmpMinimap : public ICmpMinimap 48 51 bool m_Active; 49 52 entity_pos_t m_X, m_Z; // cache the latest position for more efficient rendering; only valid when m_Active true 50 53 54 55 // Used by the minimap while pinging this entity to indicate something (e.g. an attack) 56 // Entity not pinged after MAX_PING_TURNS if it wasn't notified in between 57 static const u32 MAX_PING_FRAMES = 500; 58 bool m_PingEntity; 59 u32 m_PingCount; 60 61 62 51 63 static std::string GetSchema() 52 64 { 53 65 return … … class CCmpMinimap : public ICmpMinimap 82 94 virtual void Init(const CParamNode& paramNode) 83 95 { 84 96 m_Active = true; 97 m_PingEntity = false; 85 98 86 99 const CParamNode& colour = paramNode.GetChild("Colour"); 87 100 if (colour.IsOk()) … … class CCmpMinimap : public ICmpMinimap 183 196 184 197 break; 185 198 } 199 case MT_PingOwner: 200 { 201 // UNUSED: const CMessagePingOwner& data = static_cast<const CMessagePingOwner&> (msg); 202 203 if (!g_Game) 204 break; 205 206 CmpPtr<ICmpOwnership> cmpOwnership(GetSimContext(), GetEntityId()); 207 if (!cmpOwnership) 208 break; 209 if(g_Game->GetPlayerID() != (int)cmpOwnership->GetOwner()) 210 break; 211 212 m_Active = true; 213 m_PingEntity = true; 214 m_PingCount = MAX_PING_FRAMES; 215 216 break; 217 } 186 218 } 187 219 } 188 220 … … class CCmpMinimap : public ICmpMinimap 198 230 z = m_Z; 199 231 return true; 200 232 } 233 234 virtual bool IsEntityPinging(void) 235 { 236 if (!m_Active) 237 return false; 238 239 return m_PingEntity; 240 } 241 242 virtual u32 GetRemainingPingCount(void) 243 { 244 return m_PingCount; 245 } 246 247 virtual void SetRemainingPingCount(u32 pingCount) 248 { 249 m_PingCount = pingCount; 250 251 if (m_PingCount == 0) 252 m_PingEntity = false; 253 } 201 254 }; 202 255 203 256 REGISTER_COMPONENT_TYPE(Minimap) -
source/simulation2/components/ICmpMinimap.h
diff --git a/source/simulation2/components/ICmpMinimap.h b/source/simulation2/components/ICmpMinimap.h index e2ebf9b..fe906dd 100644
a b class ICmpMinimap : public IComponent 35 35 */ 36 36 virtual bool GetRenderData(u8& r, u8& g, u8& b, entity_pos_t& x, entity_pos_t& z) = 0; 37 37 38 /** 39 * Returns true if the unit is pinging. 40 */ 41 virtual bool IsEntityPinging(void) = 0; 42 43 /** 44 * Returns the current ping count. 45 */ 46 virtual u32 GetRemainingPingCount(void) = 0; 47 48 /** 49 * Used by the minimap to set the ping count, controls pinging. 50 */ 51 virtual void SetRemainingPingCount(u32 pingCount) = 0; 52 38 53 DECLARE_INTERFACE_TYPE(Minimap) 39 54 }; 40 55 -
source/simulation2/scripting/MessageTypeConversions.cpp
diff --git a/source/simulation2/scripting/MessageTypeConversions.cpp b/source/simulation2/scripting/MessageTypeConversions.cpp index c4109d7..9160b07 100644
a b CMessage* CMessageVisionRangeChanged::FromJSVal(ScriptInterface& scriptInterface 336 336 return new CMessageVisionRangeChanged(entity, oldRange, newRange); 337 337 } 338 338 339 //////////////////////////////// 340 341 jsval CMessagePingOwner::ToJSVal(ScriptInterface& scriptInterface) const 342 { 343 TOJSVAL_SETUP(); 344 return OBJECT_TO_JSVAL(obj); 345 } 346 347 CMessage* CMessagePingOwner::FromJSVal(ScriptInterface& UNUSED(scriptInterface), jsval UNUSED(val)) 348 { 349 // FROMJSVAL_SETUP(); 350 return new CMessagePingOwner(); 351 } 352 339 353 //////////////////////////////////////////////////////////////// 340 354 341 355 CMessage* CMessageFromJSVal(int mtid, ScriptInterface& scriptingInterface, jsval val)