aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
diff options
context:
space:
mode:
authorMW2007-07-15 23:39:52 +0000
committerMW2007-07-15 23:39:52 +0000
commit9685c65901445218d8e523f48d8b1e481ee65280 (patch)
treebdec8f005c5435105327a0fb84d095ca572fc29a /OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
parent* More scripting enhancemnents and properties. (diff)
downloadopensim-SC_OLD-9685c65901445218d8e523f48d8b1e481ee65280.zip
opensim-SC_OLD-9685c65901445218d8e523f48d8b1e481ee65280.tar.gz
opensim-SC_OLD-9685c65901445218d8e523f48d8b1e481ee65280.tar.bz2
opensim-SC_OLD-9685c65901445218d8e523f48d8b1e481ee65280.tar.xz
Couple of small changes to NPC test character.
Diffstat (limited to 'OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs')
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs24
1 files changed, 15 insertions, 9 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
index e6bc715..6b332eb 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
@@ -17,8 +17,8 @@ namespace SimpleApp
17{ 17{
18 public class MyNpcCharacter : IClientAPI 18 public class MyNpcCharacter : IClientAPI
19 { 19 {
20 private uint movementDirection = 0; 20 private uint movementFlag = 0;
21 private bool fly = true; 21 private short flyState = 0;
22 private LLQuaternion bodyDirection = LLQuaternion.Identity; 22 private LLQuaternion bodyDirection = LLQuaternion.Identity;
23 private short count = 0; 23 private short count = 0;
24 24
@@ -153,21 +153,27 @@ namespace SimpleApp
153 { 153 {
154 Encoding enc = Encoding.ASCII; 154 Encoding enc = Encoding.ASCII;
155 155
156 this.OnAgentUpdate(this, movementDirection, bodyDirection); 156 this.OnAgentUpdate(this, movementFlag, bodyDirection);
157 157
158 if (this.fly) 158 if (this.flyState == 0)
159 { 159 {
160 movementDirection = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY | (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG; 160 movementFlag = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY | (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG;
161 fly = false; 161 flyState = 1;
162 }
163 else if (this.flyState == 1)
164 {
165 movementFlag = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY | (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS;
166 flyState = 2;
162 } 167 }
163 else 168 else
164 { 169 {
165 movementDirection = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY | (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS; 170 movementFlag = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY;
166 fly = true; 171 flyState = 0;
167 } 172 }
173
168 if (count >= 40) 174 if (count >= 40)
169 { 175 {
170 this.OnChatFromViewer(enc.GetBytes("Kind of quiet around here isn't it! \0"), 2, new LLVector3(128, 128, 26), this.FirstName + " " + this.LastName, this.AgentId); 176 this.OnChatFromViewer(enc.GetBytes("Kind of quiet around here, isn't it! \0"), 2, new LLVector3(128, 128, 26), this.FirstName + " " + this.LastName, this.AgentId);
171 count = -1; 177 count = -1;
172 } 178 }
173 179