@@ -201,6 +201,7 @@ void CLuaElementDefs::AddClass ( lua_State* luaVM )
201
201
lua_registerclass ( luaVM, " Element" );
202
202
}
203
203
204
+
204
205
int CLuaElementDefs::createElement ( lua_State* luaVM )
205
206
{
206
207
// element createElement ( string elementType, [ string elementID ] )
@@ -269,6 +270,7 @@ int CLuaElementDefs::destroyElement ( lua_State* luaVM )
269
270
return 1 ;
270
271
}
271
272
273
+
272
274
int CLuaElementDefs::cloneElement ( lua_State* luaVM )
273
275
{
274
276
// element cloneElement ( element theElement, [ float xPos = 0, float yPos = 0, float zPos = 0, bool cloneChildren = false ] )
@@ -597,6 +599,7 @@ int CLuaElementDefs::getElementPosition ( lua_State* luaVM )
597
599
return 1 ;
598
600
}
599
601
602
+
600
603
int CLuaElementDefs::OOP_getElementPosition ( lua_State* luaVM )
601
604
{
602
605
CElement* pElement = NULL ;
@@ -618,6 +621,7 @@ int CLuaElementDefs::OOP_getElementPosition ( lua_State* luaVM )
618
621
return 1 ;
619
622
}
620
623
624
+
621
625
int CLuaElementDefs::getElementMatrix ( lua_State* luaVM )
622
626
{
623
627
CElement* pElement = NULL ;
@@ -699,6 +703,7 @@ int CLuaElementDefs::getElementMatrix ( lua_State* luaVM )
699
703
return 1 ;
700
704
}
701
705
706
+
702
707
int CLuaElementDefs::OOP_getElementMatrix ( lua_State* luaVM )
703
708
{
704
709
CElement* pEntity = NULL ;
@@ -751,6 +756,7 @@ int CLuaElementDefs::getElementRotation ( lua_State* luaVM )
751
756
return 1 ;
752
757
}
753
758
759
+
754
760
int CLuaElementDefs::OOP_getElementRotation ( lua_State* luaVM )
755
761
{
756
762
CElement* pElement = NULL ;
@@ -777,6 +783,7 @@ int CLuaElementDefs::OOP_getElementRotation ( lua_State* luaVM )
777
783
return 1 ;
778
784
}
779
785
786
+
780
787
int CLuaElementDefs::getElementVelocity ( lua_State* luaVM )
781
788
{
782
789
// float float float getElementVelocity ( element theElement )
@@ -805,6 +812,7 @@ int CLuaElementDefs::getElementVelocity ( lua_State* luaVM )
805
812
return 1 ;
806
813
}
807
814
815
+
808
816
int CLuaElementDefs::OOP_getElementVelocity ( lua_State* luaVM )
809
817
{
810
818
CElement* pElement = NULL ;
@@ -827,6 +835,7 @@ int CLuaElementDefs::OOP_getElementVelocity ( lua_State* luaVM )
827
835
return 1 ;
828
836
}
829
837
838
+
830
839
int CLuaElementDefs::getElementType ( lua_State* luaVM )
831
840
{
832
841
// string getElementType ( element theElement )
@@ -898,6 +907,7 @@ int CLuaElementDefs::getElementInterior ( lua_State* luaVM )
898
907
return 1 ;
899
908
}
900
909
910
+
901
911
int CLuaElementDefs::isElementWithinMarker ( lua_State* luaVM )
902
912
{
903
913
// bool isElementWithinMarker ( element theElement, marker theMarker )
@@ -1147,6 +1157,8 @@ int CLuaElementDefs::setElementAttachedOffsets ( lua_State* luaVM )
1147
1157
1148
1158
if ( !argStream.HasErrors () )
1149
1159
{
1160
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
1161
+
1150
1162
if ( CStaticFunctionDefinitions::SetElementAttachedOffsets ( pElement, vecPosition, vecRotation ) )
1151
1163
{
1152
1164
lua_pushboolean ( luaVM, true );
@@ -1342,6 +1354,7 @@ int CLuaElementDefs::getElementSyncer ( lua_State* luaVM )
1342
1354
return 1 ;
1343
1355
}
1344
1356
1357
+
1345
1358
int CLuaElementDefs::getElementCollisionsEnabled ( lua_State* luaVM )
1346
1359
{
1347
1360
// bool getElementCollisionsEnabled ( element theElement )
@@ -1483,6 +1496,8 @@ int CLuaElementDefs::setElementID ( lua_State* luaVM )
1483
1496
1484
1497
if ( !argStream.HasErrors () )
1485
1498
{
1499
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
1500
+
1486
1501
if ( CStaticFunctionDefinitions::SetElementID ( pElement, strId ) )
1487
1502
{
1488
1503
lua_pushboolean ( luaVM, true );
@@ -1513,6 +1528,8 @@ int CLuaElementDefs::setElementData ( lua_State* luaVM )
1513
1528
CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine ( luaVM );
1514
1529
if ( pLuaMain )
1515
1530
{
1531
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
1532
+
1516
1533
if ( strKey.length () > MAX_CUSTOMDATA_NAME_LENGTH )
1517
1534
{
1518
1535
// Warn and truncate if key is too long
@@ -1549,6 +1566,8 @@ int CLuaElementDefs::removeElementData ( lua_State* luaVM )
1549
1566
CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine ( luaVM );
1550
1567
if ( pLuaMain )
1551
1568
{
1569
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
1570
+
1552
1571
if ( strKey.length () > MAX_CUSTOMDATA_NAME_LENGTH )
1553
1572
{
1554
1573
// Warn and truncate if key is too long
@@ -1594,6 +1613,8 @@ int CLuaElementDefs::setElementMatrix ( lua_State* luaVM )
1594
1613
// Verify the arguments
1595
1614
if ( !argStream.HasErrors ( ) )
1596
1615
{
1616
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
1617
+
1597
1618
if ( CStaticFunctionDefinitions::SetElementMatrix ( pElement, matrix ) )
1598
1619
{
1599
1620
lua_pushboolean ( luaVM, true );
@@ -1620,6 +1641,8 @@ int CLuaElementDefs::setElementParent ( lua_State* luaVM )
1620
1641
1621
1642
if ( !argStream.HasErrors () )
1622
1643
{
1644
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
1645
+
1623
1646
if ( CStaticFunctionDefinitions::SetElementParent ( pElement, pParent ) )
1624
1647
{
1625
1648
lua_pushboolean ( luaVM, true );
@@ -1658,6 +1681,8 @@ int CLuaElementDefs::setElementPosition ( lua_State* luaVM )
1658
1681
1659
1682
if ( !argStream.HasErrors () )
1660
1683
{
1684
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
1685
+
1661
1686
// Set the position
1662
1687
if ( CStaticFunctionDefinitions::SetElementPosition ( pElement, vecPosition, bWarp ) )
1663
1688
{
@@ -1686,6 +1711,8 @@ int CLuaElementDefs::setElementRotation ( lua_State* luaVM )
1686
1711
1687
1712
if ( !argStream.HasErrors () )
1688
1713
{
1714
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
1715
+
1689
1716
// Set the rotation
1690
1717
if ( CStaticFunctionDefinitions::SetElementRotation ( pElement, vecRotation, rotationOrder, bNewWay ) )
1691
1718
{
@@ -1700,6 +1727,7 @@ int CLuaElementDefs::setElementRotation ( lua_State* luaVM )
1700
1727
return 1 ;
1701
1728
}
1702
1729
1730
+
1703
1731
int CLuaElementDefs::OOP_setElementRotation ( lua_State* luaVM )
1704
1732
{
1705
1733
// element.rotation = Vector3
@@ -1712,6 +1740,8 @@ int CLuaElementDefs::OOP_setElementRotation ( lua_State* luaVM )
1712
1740
1713
1741
if ( !argStream.HasErrors () )
1714
1742
{
1743
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
1744
+
1715
1745
CMatrix matrix;
1716
1746
1717
1747
// fill in our matrix
@@ -1749,6 +1779,7 @@ int CLuaElementDefs::OOP_setElementRotation ( lua_State* luaVM )
1749
1779
return 1 ;
1750
1780
}
1751
1781
1782
+
1752
1783
int CLuaElementDefs::setElementVelocity ( lua_State* luaVM )
1753
1784
{
1754
1785
// bool setElementVelocity ( element theElement, float speedX, float speedY, float speedZ )
@@ -1760,6 +1791,8 @@ int CLuaElementDefs::setElementVelocity ( lua_State* luaVM )
1760
1791
1761
1792
if ( !argStream.HasErrors () )
1762
1793
{
1794
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
1795
+
1763
1796
// Set the velocity
1764
1797
if ( CStaticFunctionDefinitions::SetElementVelocity ( pElement, vecVelocity ) )
1765
1798
{
@@ -1787,6 +1820,8 @@ int CLuaElementDefs::setElementVisibleTo ( lua_State* luaVM )
1787
1820
1788
1821
if ( !argStream.HasErrors () )
1789
1822
{
1823
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
1824
+
1790
1825
if ( CStaticFunctionDefinitions::SetElementVisibleTo ( pElement, pReference, bVisible ) )
1791
1826
{
1792
1827
lua_pushboolean ( luaVM, true );
@@ -1814,6 +1849,8 @@ int CLuaElementDefs::setElementInterior ( lua_State* luaVM )
1814
1849
1815
1850
if ( !argStream.HasErrors () )
1816
1851
{
1852
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
1853
+
1817
1854
unsigned char ucInterior = static_cast < unsigned char > ( uiInterior );
1818
1855
if ( CStaticFunctionDefinitions::SetElementInterior ( pElement, ucInterior, bSetPosition, vecPosition ) )
1819
1856
{
@@ -1853,6 +1890,8 @@ int CLuaElementDefs::setElementDimension ( lua_State* luaVM )
1853
1890
1854
1891
if ( !argStream.HasErrors () )
1855
1892
{
1893
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
1894
+
1856
1895
if ( bMakeVisibleInAllDimensions )
1857
1896
{
1858
1897
// Set the object visible in all dimensions
@@ -1905,6 +1944,8 @@ int CLuaElementDefs::attachElements ( lua_State* luaVM )
1905
1944
1906
1945
if ( !argStream.HasErrors () )
1907
1946
{
1947
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
1948
+
1908
1949
if ( CStaticFunctionDefinitions::AttachElements ( pElement, pAttachedToElement, vecPosition, vecRotation ) )
1909
1950
{
1910
1951
lua_pushboolean ( luaVM, true );
@@ -1930,6 +1971,8 @@ int CLuaElementDefs::detachElements ( lua_State* luaVM )
1930
1971
1931
1972
if ( !argStream.HasErrors () )
1932
1973
{
1974
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
1975
+
1933
1976
if ( CStaticFunctionDefinitions::DetachElements ( pElement, pAttachedToElement ) )
1934
1977
{
1935
1978
lua_pushboolean ( luaVM, true );
@@ -1955,6 +1998,8 @@ int CLuaElementDefs::setElementAlpha ( lua_State* luaVM )
1955
1998
1956
1999
if ( !argStream.HasErrors () )
1957
2000
{
2001
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
2002
+
1958
2003
if ( CStaticFunctionDefinitions::SetElementAlpha ( pElement, ucAlpha ) )
1959
2004
{
1960
2005
lua_pushboolean ( luaVM, true );
@@ -2005,6 +2050,8 @@ int CLuaElementDefs::setElementHealth ( lua_State* luaVM )
2005
2050
2006
2051
if ( !argStream.HasErrors () )
2007
2052
{
2053
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
2054
+
2008
2055
if ( CStaticFunctionDefinitions::SetElementHealth ( pElement, fHealth ) )
2009
2056
{
2010
2057
lua_pushboolean ( luaVM, true );
@@ -2030,6 +2077,8 @@ int CLuaElementDefs::setElementModel ( lua_State* luaVM )
2030
2077
2031
2078
if ( !argStream.HasErrors () )
2032
2079
{
2080
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
2081
+
2033
2082
if ( CStaticFunctionDefinitions::SetElementModel ( pElement, usModel ) )
2034
2083
{
2035
2084
lua_pushboolean ( luaVM, true );
@@ -2043,6 +2092,7 @@ int CLuaElementDefs::setElementModel ( lua_State* luaVM )
2043
2092
return 1 ;
2044
2093
}
2045
2094
2095
+
2046
2096
int CLuaElementDefs::setElementSyncer ( lua_State* luaVM )
2047
2097
{
2048
2098
// bool setElementSyncer ( element theElement, player thePlayer )
@@ -2068,6 +2118,7 @@ int CLuaElementDefs::setElementSyncer ( lua_State* luaVM )
2068
2118
return 1 ;
2069
2119
}
2070
2120
2121
+
2071
2122
int CLuaElementDefs::setElementCollisionsEnabled ( lua_State* luaVM )
2072
2123
{
2073
2124
// bool setElementCollisionsEnabled ( element theElement, bool enabled )
@@ -2079,6 +2130,8 @@ int CLuaElementDefs::setElementCollisionsEnabled ( lua_State* luaVM )
2079
2130
2080
2131
if ( !argStream.HasErrors () )
2081
2132
{
2133
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
2134
+
2082
2135
if ( CStaticFunctionDefinitions::SetElementCollisionsEnabled ( pElement, bEnable ) )
2083
2136
{
2084
2137
lua_pushboolean ( luaVM, true );
@@ -2092,6 +2145,7 @@ int CLuaElementDefs::setElementCollisionsEnabled ( lua_State* luaVM )
2092
2145
return 1 ;
2093
2146
}
2094
2147
2148
+
2095
2149
int CLuaElementDefs::setElementFrozen ( lua_State* luaVM )
2096
2150
{
2097
2151
// bool setElementFrozen ( element theElement, bool freezeStatus )
@@ -2103,6 +2157,8 @@ int CLuaElementDefs::setElementFrozen ( lua_State* luaVM )
2103
2157
2104
2158
if ( !argStream.HasErrors () )
2105
2159
{
2160
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
2161
+
2106
2162
if ( CStaticFunctionDefinitions::SetElementFrozen ( pElement, bFrozen ) )
2107
2163
{
2108
2164
lua_pushboolean ( luaVM, true );
@@ -2141,6 +2197,7 @@ int CLuaElementDefs::getLowLODElement ( lua_State* luaVM )
2141
2197
return 1 ;
2142
2198
}
2143
2199
2200
+
2144
2201
int CLuaElementDefs::setLowLODElement ( lua_State* luaVM )
2145
2202
{
2146
2203
// bool setLowLODElement ( element theElement )
@@ -2202,6 +2259,8 @@ int CLuaElementDefs::setElementCallPropagationEnabled ( lua_State* luaVM )
2202
2259
2203
2260
if ( !argStream.HasErrors () )
2204
2261
{
2262
+ LogWarningIfPlayerHasNotJoinedYet ( luaVM, pEntity );
2263
+
2205
2264
if ( CStaticFunctionDefinitions::SetElementCallPropagationEnabled ( pEntity, bEnable ) )
2206
2265
{
2207
2266
lua_pushboolean ( luaVM, true );
0 commit comments