Ticket #1887: rubble_ownership.patch

File rubble_ownership.patch, 1.8 KB (added by Eric Bobbitt, 11 years ago)

Patch to set ownership on rubble entities

  • binaries/data/mods/public/simulation/components/Health.js

    From c54c42f2651811bc6eff21292320930c76170dd8 Mon Sep 17 00:00:00 2001
    From: = <eric@hellouser.net>
    Date: Thu, 4 Apr 2013 20:27:41 -0500
    Subject: [PATCH] Added ownership component to rubble entities so that player
     colors will show up in the rubble actors
    
    ---
     binaries/data/mods/public/simulation/components/Health.js          |    4 ++++
     binaries/data/mods/public/simulation/templates/template_rubble.xml |    3 ++-
     2 files changed, 6 insertions(+), 1 deletion(-)
    
    diff --git a/binaries/data/mods/public/simulation/components/Health.js b/binaries/data/mods/public/simulation/components/Health.js
    index 2adbe02..6b5950f 100644
    a b Health.prototype.CreateDeathSpawnedEntity = function()  
    242242    cmpSpawnedPosition.SetYRotation(rot.y);
    243243    cmpSpawnedPosition.SetXZRotation(rot.x, rot.z);
    244244
     245    var cmpOwnership = Engine.QueryInterface(this.entity, IID_Ownership);
     246    var cmpSpawnedOwnership = Engine.QueryInterface(spawnedEntity, IID_Ownership);
     247    cmpSpawnedOwnership.SetOwner(cmpOwnership.GetOwner());
     248   
    245249    return spawnedEntity;
    246250};
    247251
  • binaries/data/mods/public/simulation/templates/template_rubble.xml

    diff --git a/binaries/data/mods/public/simulation/templates/template_rubble.xml b/binaries/data/mods/public/simulation/templates/template_rubble.xml
    index 6df121d..a7b4a9f 100644
    a b  
    11<?xml version="1.0" encoding="utf-8"?>
    22<Entity>
     3  <Ownership/>
    34  <Decay>
    45    <DelayTime>15.0</DelayTime>
    56    <SinkRate>0.2</SinkRate>
     
    2122    <SilhouetteDisplay>false</SilhouetteDisplay>
    2223    <SilhouetteOccluder>false</SilhouetteOccluder>
    2324  </VisualActor>
    24 </Entity>
    25  No newline at end of file
     25</Entity>